When running with --fake-super, get/put ACLs from/to an xattr and don't
[rsync/rsync.git] / match.c
diff --git a/match.c b/match.c
index 9719319..8367d15 100644 (file)
--- a/match.c
+++ b/match.c
@@ -6,8 +6,9 @@
  * Copyright (C) 2003-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,8 +16,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
  */
 
 #include "rsync.h"
@@ -315,21 +315,23 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
        sum_init(checksum_seed);
 
        if (append_mode > 0) {
-               OFF_T j = 0;
-               for (j = CHUNK_SIZE; j < s->flength; j += CHUNK_SIZE) {
-                       if (buf && do_progress)
-                               show_progress(last_match, buf->file_size);
-                       sum_update(map_ptr(buf, last_match, CHUNK_SIZE),
-                                  CHUNK_SIZE);
-                       last_match = j;
-               }
-               if (last_match < s->flength) {
-                       int32 n = (int32)(s->flength - last_match);
-                       if (buf && do_progress)
-                               show_progress(last_match, buf->file_size);
-                       sum_update(map_ptr(buf, last_match, n), n);
-                       last_match = s->flength;
+               if (append_mode == 2) {
+                       OFF_T j = 0;
+                       for (j = CHUNK_SIZE; j < s->flength; j += CHUNK_SIZE) {
+                               if (buf && do_progress)
+                                       show_progress(last_match, buf->file_size);
+                               sum_update(map_ptr(buf, last_match, CHUNK_SIZE),
+                                          CHUNK_SIZE);
+                               last_match = j;
+                       }
+                       if (last_match < s->flength) {
+                               int32 n = (int32)(s->flength - last_match);
+                               if (buf && do_progress)
+                                       show_progress(last_match, buf->file_size);
+                               sum_update(map_ptr(buf, last_match, n), n);
+                       }
                }
+               last_match = s->flength;
                s->count = 0;
        }