Fixed a problem with build_hash_table() getting called too
authorWayne Davison <wayned@samba.org>
Sat, 27 Oct 2007 04:41:18 +0000 (04:41 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 27 Oct 2007 04:41:18 +0000 (04:41 +0000)
often when overwriting a shorter file.

match.c

diff --git a/match.c b/match.c
index 01e9117..79e591a 100644 (file)
--- a/match.c
+++ b/match.c
@@ -171,7 +171,10 @@ static void hash_search(int f,struct sum_struct *s,
 
                if (offset >= reset) {
                        sum_pos = build_hash_table(s, sum_pos);
-                       reset = sum_pos * s->blength;
+                       if (sum_pos == s->count)
+                               reset = len;
+                       else
+                               reset = sum_pos * s->blength;
                }
 
                if (verbose > 4) {