Fix --remove-source-files sanity check w/--copy-links the right way.
[rsync.git] / batch.c
diff --git a/batch.c b/batch.c
index 42f7be1944490c124e21b292c4e660e59880cb56..1ab66e90aeff136aefd28c4415282b9ef88e18f2 100644 (file)
--- a/batch.c
+++ b/batch.c
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1999 Weiss
  * Copyright (C) 2004 Chris Shoemaker
- * Copyright (C) 2004-2015 Wayne Davison
+ * Copyright (C) 2004-2018 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -216,7 +216,7 @@ static void write_filter_rules(int fd)
 void write_batch_shell_file(int argc, char *argv[], int file_arg_cnt)
 {
        int fd, i, len, err = 0;
-       char *p, filename[MAXPATHLEN];
+       char *p, *p2, filename[MAXPATHLEN];
 
        stringjoin(filename, sizeof filename,
                   batch_name, ".sh", NULL);
@@ -267,7 +267,7 @@ void write_batch_shell_file(int argc, char *argv[], int file_arg_cnt)
                                err = 1;
                }
        }
-       if (!(p = check_for_hostspec(argv[argc - 1], &p, &i)))
+       if (!(p = check_for_hostspec(argv[argc - 1], &p2, &i)))
                p = argv[argc - 1];
        if (write(fd, " ${1:-", 6) != 6
         || write_arg(fd, p) < 0)