File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ struct line {
204
204
unsigned hash : 24 ;
205
205
unsigned flag : 8 ;
206
206
#define LINE_COMMON 1
207
+ #define LINE_PATCHED 2
207
208
};
208
209
209
210
/*
@@ -2085,7 +2086,8 @@ static int match_fragment(struct image *img,
2085
2086
2086
2087
/* Quick hash check */
2087
2088
for (i = 0 ; i < preimage_limit ; i ++ )
2088
- if (preimage -> line [i ].hash != img -> line [try_lno + i ].hash )
2089
+ if ((img -> line [try_lno + i ].flag & LINE_PATCHED ) ||
2090
+ (preimage -> line [i ].hash != img -> line [try_lno + i ].hash ))
2089
2091
return 0 ;
2090
2092
2091
2093
if (preimage_limit == preimage -> nr ) {
@@ -2428,6 +2430,9 @@ static void update_image(struct image *img,
2428
2430
memcpy (img -> line + applied_pos ,
2429
2431
postimage -> line ,
2430
2432
postimage -> nr * sizeof (* img -> line ));
2433
+ for (i = 0 ; i < postimage -> nr ; i ++ )
2434
+ img -> line [applied_pos + i ].flag |= LINE_PATCHED ;
2435
+
2431
2436
img -> nr = nr ;
2432
2437
}
2433
2438
You can’t perform that action at this time.
0 commit comments