X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/7f9bf6b710362860ff801855b8939bdd28fc838f..4e90cfbfeda6d6956d547d9bed5c6763c9d596ba:/io.c diff --git a/io.c b/io.c index ce675d20..60062f90 100644 --- a/io.c +++ b/io.c @@ -352,8 +352,7 @@ static void check_for_d_option_error(const char *msg) if (saw_d) { rprintf(FWARNING, - "*** Try adding \"-r --exclude='/*/*'\" " - "if remote rsync is <= 2.6.3 ***\n"); + "*** Try using \"--old-d\" if remote rsync is <= 2.6.3 ***\n"); } } @@ -874,8 +873,8 @@ int read_line(int fd, char *buf, size_t bufsiz, int flags) return s - buf; } -int read_args(int f_in, char *mod_name, char *buf, size_t bufsiz, int rl_nulls, - char ***argv_p, int *argc_p, char **request_p) +void read_args(int f_in, char *mod_name, char *buf, size_t bufsiz, int rl_nulls, + char ***argv_p, int *argc_p, char **request_p) { int maxargs = MAX_ARGS; int dot_pos = 0; @@ -889,14 +888,14 @@ int read_args(int f_in, char *mod_name, char *buf, size_t bufsiz, int rl_nulls, if (!(argv = new_array(char *, maxargs))) out_of_memory("read_args"); - if (mod_name) + if (mod_name && !protect_args) argv[argc++] = "rsyncd"; while (1) { if (read_line(f_in, buf, bufsiz, rl_flags) == 0) break; - if (argc == maxargs) { + if (argc == maxargs-1) { maxargs += MAX_ARGS; if (!(argv = realloc_array(argv, char *, maxargs))) out_of_memory("read_args"); @@ -919,11 +918,12 @@ int read_args(int f_in, char *mod_name, char *buf, size_t bufsiz, int rl_nulls, dot_pos = argc; } } + argv[argc] = NULL; + + glob_expand(NULL, NULL, NULL, NULL); *argc_p = argc; *argv_p = argv; - - return dot_pos ? dot_pos : argc; } int io_start_buffering_out(int f_out)