X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a4453606ccf4aa3853588af2883d77d4e4df81bc..c50a9076e120e1600823cc8e901dbefd89f1f5d7:/options.c diff --git a/options.c b/options.c index c868cfe4..ff7c1431 100644 --- a/options.c +++ b/options.c @@ -20,6 +20,7 @@ */ #include "rsync.h" +#include "ifuncs.h" #include #include "zlib/zlib.h" @@ -463,7 +464,6 @@ static struct poptOption long_options[] = { {"no-inc-recursive", 0, POPT_ARG_VAL, &allow_inc_recurse, 0, 0, 0 }, {"i-r", 0, POPT_ARG_VAL, &allow_inc_recurse, 1, 0, 0 }, {"no-i-r", 0, POPT_ARG_VAL, &allow_inc_recurse, 0, 0, 0 }, - {"no-ir", 0, POPT_ARG_VAL, &allow_inc_recurse, 0, 0, 0 }, /* XXX remove soon */ {"dirs", 'd', POPT_ARG_VAL, &xfer_dirs, 2, 0, 0 }, {"no-dirs", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 }, {"no-d", 0, POPT_ARG_VAL, &xfer_dirs, 0, 0, 0 }, @@ -1003,15 +1003,17 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) if (sanitize_paths) arg = sanitize_path(NULL, arg, NULL, 0, NULL); if (server_filter_list.head) { + int rej; char *cp = strdup(arg); if (!cp) out_of_memory("parse_arguments"); if (!*cp) goto options_rejected; clean_fname(cp, 1); - if (check_filter(&server_filter_list, cp, 0) < 0) - goto options_rejected; + rej = check_filter(&server_filter_list, cp, 0) < 0; free(cp); + if (rej) + goto options_rejected; } parse_filter_file(&filter_list, arg, opt == OPT_INCLUDE_FROM ? MATCHFLG_INCLUDE : 0, @@ -1930,7 +1932,7 @@ void server_options(char **args, int *argc_p) args[ac++] = "--numeric-ids"; if (!allow_inc_recurse) - args[ac++] = "--no-ir"; /* XXX change to --no-i-r soon */ + args[ac++] = "--no-i-r"; if (am_sender) { if (ignore_existing) @@ -1978,7 +1980,8 @@ void server_options(char **args, int *argc_p) if (!relative_paths) args[ac++] = "--no-relative"; } - if (relative_paths && !implied_dirs && !am_sender) + /* It's OK that this checks the upper-bound of the protocol_version. */ + if (relative_paths && !implied_dirs && (!am_sender || protocol_version >= 30)) args[ac++] = "--no-implied-dirs"; if (fuzzy_basis && am_sender)