On Sun, 3 Sep 2006, viq wrote:
> As additional information, with a help of friend tested that on a
> FreeBSD system (he says it's somewhat out of date, half a year). Patch
> --version told it's version 2.1, and it produced same results as
> OpenBSD's patch. So, what's the verdict? Is it a problem worth
> reporting, or just a minor nuisance?
Well, I did some digging at it is really a problem. In case of fuzzy
patching, it can happen that if the diff has no full context (before
and after context of 3 lines), too few (in this case zero) lines are
used to match context. In this case it will result in the diff being
applied at te line number without checking context.
The problem is in patch.c:patch_match(), where the fuzz factor is
added to the start and subtracted from the end.
GNU patch has fixes for these cases, by taking into acount that a full
context might not be present.
As for reporting, you already did. ;-)
-Otto