mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-20 21:04:15 -04:00
Changed the checks for --inplace to use the new updating_basis_file
variable.
This commit is contained in:
1 parent
17b5b32f75
commit
a36ffd3910
1 file changed
+7
-7
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user