- int f;
- int i;
- char buff[256]; /* XXX */
- char buff2[MAXPATHLEN + 6];
- char filename[MAXPATHLEN];
-
- stringjoin(filename, sizeof filename,
- batch_prefix, rsync_argvs_file, NULL);
-
- f = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC,
- S_IRUSR | S_IWUSR | S_IEXEC);
- if (f < 0) {
- rsyserr(FERROR, errno, "Batch file %s open error", filename);
- exit_cleanup(1);
- }
- buff[0] = '\0';
-
- /* Write argvs info to batch file */
-
- for (i = 0; i < argc; ++i) {
- if (i == argc - 2) /* Skip source directory on cmdline */
- continue;
- /*
- * FIXME:
- * I think directly manipulating argv[] is probably bogus
- */
- if (!strncmp(argv[i], "--write-batch",
- strlen("--write-batch"))) {
- /* Safer to change it here than script */
- /*
- * Change to --read-batch=prefix
- * to get ready for remote
- */
- strlcat(buff, "--read-batch=", sizeof buff);
- strlcat(buff, batch_prefix, sizeof buff);
- } else
- if (i == argc - 1) {
- snprintf(buff2, sizeof buff2, "${1:-%s}", argv[i]);
- strlcat(buff, buff2, sizeof buff);
- }
- else {
- strlcat(buff, argv[i], sizeof buff);
+ int i, flags;
+
+ fudged_recurse = recurse < 0;
+ if (protocol_version < 29)
+ xfer_dirs = 0;
+ for (i = 0, flags = read_int(fd); flag_ptr[i]; i++) {
+ int set = flags & (1 << i) ? 1 : 0;
+ if (*flag_ptr[i] != set) {
+ if (verbose) {
+ rprintf(FINFO,
+ "%sing the %s option to match the batchfile.\n",
+ set ? "Sett" : "Clear", flag_name[i]);
+ }
+ *flag_ptr[i] = set;