]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Don't allow --remove-s*-files with --read-batch.
authorWayne Davison <wayned@samba.org>
Sun, 12 Apr 2009 19:57:31 +0000 (12:57 -0700)
committerWayne Davison <wayned@samba.org>
Sun, 12 Apr 2009 20:01:14 +0000 (13:01 -0700)
NEWS
options.c

diff --git a/NEWS b/NEWS
index 836d476873ee9579e63875014e36270c85654e34..45ff1bdd35e5071fbd02156a1ebd0381bdab7b31 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -47,3 +47,6 @@ Changes since 3.0.5:
 
     - Fixed a run-time issue for systems that can't find iconv_open() by adding
       the --disable-iconv-open configure option.
+
+    - Complain and die if the user tries to combine --remove-source-files (or
+      the deprecated --remove-sent-files) with --read-batch.
index 75fa1ab6147905295e24262e01b986dbbb47ecc5..b6f7bae4c5208d8fa2d614f0de2cc3f94b2b9f64 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1357,6 +1357,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        "--read-batch cannot be used with --files-from\n");
                return 0;
        }
+       if (read_batch && remove_source_files) {
+               snprintf(err_buf, sizeof err_buf,
+                       "--read-batch cannot be used with --remove-%s-files\n",
+                       remove_source_files == 1 ? "source" : "sent");
+               return 0;
+       }
        if (batch_name && strlen(batch_name) > MAX_BATCH_NAME_LEN) {
                snprintf(err_buf, sizeof err_buf,
                        "the batch-file name must be %d characters or less.\n",