Changed the checks for --inplace to use the new updating_basis_file
authorWayne Davison <wayned@samba.org>
Mon, 17 Jan 2005 23:11:13 +0000 (23:11 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 17 Jan 2005 23:11:13 +0000 (23:11 +0000)
variable.

match.c

diff --git a/match.c b/match.c
index 031cc30..55c6d13 100644 (file)
--- a/match.c
+++ b/match.c
@@ -23,8 +23,8 @@ extern int verbose;
 extern int am_server;
 extern int do_progress;
 extern int checksum_seed;
-extern int inplace;
-extern int make_backups;
+
+int updating_basis_file;
 
 typedef unsigned short tag;
 
@@ -206,9 +206,9 @@ static void hash_search(int f,struct sum_struct *s,
                        if (l != s->sums[i].len)
                                continue;
 
-                       /* inplace: ensure chunk's offset is either >= our
+                       /* in-place: ensure chunk's offset is either >= our
                         * offset or that the data didn't move. */
-                       if (inplace && !make_backups && s->sums[i].offset < offset
+                       if (updating_basis_file && s->sums[i].offset < offset
                            && !(s->sums[i].flags & SUMFLG_SAME_OFFSET))
                                continue;
 
@@ -227,10 +227,10 @@ static void hash_search(int f,struct sum_struct *s,
                                continue;
                        }
 
-                       /* If inplace is enabled, the best possible match is
+                       /* When updating in-place, the best possible match is
                         * one with an identical offset, so we prefer that over
                         * the following want_i optimization. */
-                       if (inplace && !make_backups) {
+                       if (updating_basis_file) {
                                do {
                                        size_t i2 = targets[j].i;
                                        if (s->sums[i2].offset != offset)
@@ -253,7 +253,7 @@ static void hash_search(int f,struct sum_struct *s,
                        /* we've found a match, but now check to see
                         * if want_i can hint at a better match. */
                        if (i != want_i && want_i < s->count
-                           && (!inplace || make_backups || s->sums[want_i].offset >= offset
+                           && (!updating_basis_file || s->sums[want_i].offset >= offset
                             || s->sums[want_i].flags & SUMFLG_SAME_OFFSET)
                            && sum == s->sums[want_i].sum1
                            && memcmp(sum2, s->sums[want_i].sum2, s->s2length) == 0) {