On Thu, 31 Aug 2006, viq wrote:
> Before I submit a problem report I thought I'd ask whether it's a
> known issue, or maybe not an issue at all.
>
> 'patch' is supposed to be flexible enough to find the places to apply
> patches even when the context doesn't match in 100% - yet it doesn't
> seem to work that reliably on OpenBSD. For comparison output from a
> linux box, and the offending files attached inline.
The last hunk has this context:
@@ -38,3 +52,12 @@
silc-servers.h \
silc-chatnets.h
<empty line>
The file has this content:
silc-servers.h \
silc-chatnets.h \
silc-cmdqueue.h
<empty line>
Result is:
silc-servers.h \
silc-chatnets.h \
<new lines from diff>
silc-cmdqueue.h
<empty line>
out patch places the new content after the silc-chatnets.h \ line,
based on the fact that the silc-servers.h \ line was the last matching
line of context, and skipping the silc-chatnets.h context line because
it does not match. I'd say that is not a bad guess. Applying a patch
with fuzz is always using heuristics, as explained in the manual page.
Now I don't know if GNU patch has a more smart heuristic for this
case, but it could very well be just good luck GNU patch is appplying
the hunk at a better place, in this particluar case.
-Otto