commit - bfc912128ca404176d8aebc46b2c89ee4926e1d2
commit + 122e16119c68804932abae9efbce7cad48a85a24
blob - 752292f3b5f9c267edf95a24e15610ec05c60613
blob + d89b541d0dedd769040cf62df12ad6582091b1d0
--- lib/patch.c
+++ lib/patch.c
}
static const struct got_error *
-locate_hunk(FILE *orig, struct got_patch_hunk *h, long *lineno)
+locate_hunk(FILE *orig, struct got_patch_hunk *h, off_t *pos, long *lineno)
{
const struct got_error *err = NULL;
char *line = NULL;
}
if (err == NULL) {
+ *pos = match;
*lineno = match_lineno;
if (fseek(orig, match, SEEK_SET) == -1)
err = got_error_from_errno("fseek");
break;
tryagain:
- err = locate_hunk(orig, h, &lineno);
+ err = locate_hunk(orig, h, &pos, &lineno);
if (err != NULL)
goto done;
- if (!p->nop)
- err = copy(tmp, orig, copypos, pos);
+ err = copy(tmp, orig, copypos, pos);
if (err != NULL)
goto done;
copypos = pos;