diff options
author | Wayne Davison <wayned@samba.org> | 2004-07-19 00:53:49 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2004-07-19 00:53:49 +0000 |
commit | b462781fd06838f95aa26ca7e868c87809483f05 (patch) | |
tree | d5c89a44c8b21dfee079d9c069935c129a57a973 /batch.c | |
parent | 93095cbe99154752c92c1d112cac139852b715a5 (diff) | |
download | android_external_rsync-b462781fd06838f95aa26ca7e868c87809483f05.tar.gz android_external_rsync-b462781fd06838f95aa26ca7e868c87809483f05.tar.bz2 android_external_rsync-b462781fd06838f95aa26ca7e868c87809483f05.zip |
Fixed the argv munging to work properly regardless of whether the
user specified a trailing '=VALUE' or put the value in a separate
arg.
Diffstat (limited to 'batch.c')
-rw-r--r-- | batch.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -16,7 +16,7 @@ void write_batch_argvs_file(int argc, char *argv[]) char filename[MAXPATHLEN]; stringjoin(filename, sizeof filename, - batch_name, ".rsync_argvs", NULL); + batch_name, ".sh", NULL); fd = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IEXEC); if (fd < 0) { @@ -28,13 +28,16 @@ void write_batch_argvs_file(int argc, char *argv[]) for (i = 0; i < argc; i++) { if (i == argc - 2) /* Skip source directory on cmdline */ continue; - if (strncmp(argv[i], "--files-from=", 13) == 0) + if (strncmp(argv[i], "--files-from", 12) == 0) { + if (strchr(argv[i], '=') == NULL) + i++; continue; + } if (i != 0) write(fd, " ", 1); - if (strncmp(argv[i], "--write-batch=", 14) == 0) { - write(fd, "--read-batch=", 13); - write(fd, batch_name, strlen(batch_name)); + if (strncmp(argv[i], "--write-batch", 13) == 0) { + write(fd, "--read", 6); + write(fd, argv[i] + 7, strlen(argv[i] + 7)); } else if (i == argc - 1) { char *p = find_colon(argv[i]); if (p) { |