#include "rsync.h"
#include <time.h>
-extern char *batch_prefix;
+extern char *batch_name;
void write_batch_argvs_file(int argc, char *argv[])
{
char filename[MAXPATHLEN];
stringjoin(filename, sizeof filename,
- batch_prefix, ".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) {
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_prefix, strlen(batch_prefix));
+ 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) {