commit d7c808b798d30921f53b27c8789f3449e86bc8d8 from: Omar Polo date: Mon Aug 01 13:47:24 2022 UTC locate_hunk: set mangled earlier for clarity suggested by stsp@; no functional change. commit - 57b1c3f23ff1e0399a97ed8d7a57fef8471e188f commit + d7c808b798d30921f53b27c8789f3449e86bc8d8 blob - e1e9258d4e6f76c6226e2040023e078361240dd1 blob + 4b795cc39551259dc64fe67a92381bb2c0591143 --- lib/patch.c +++ lib/patch.c @@ -414,12 +414,12 @@ locate_hunk(FILE *orig, struct got_patch_hunk *h, off_ match_lineno = (*lineno)-1; } - if (*lineno >= h->old_from && match != -1) + if (*lineno >= h->old_from && match != -1) { + if (mangled) + h->ws_mangled = 1; break; + } } - - if (mangled) - h->ws_mangled = 1; if (err == NULL) { *pos = match;