HomeFreeBSD

MFC r326084: patch(1): don't assume match if we run out of context to check

Description

MFC r326084: patch(1): don't assume match if we run out of context to check

Patches with very little context (-U0 and -U1) could get misapplied if
the file to be patched changes and a hunk is no longer applicable. Matching
with fuzz would be attempted and default to a match when we unexpectedly ran
out of context.

This also affected patches with higher levels of context but had limited
actual context due to the hunk being located near the beginning/end of file.

PR: 74127

Details

Provenance
kevansAuthored on
Parents
rS328147: MFC r324431: patch(1): Don't overrun line buffer in some cases
Branches
Unknown
Tags
Unknown