I believe that this is unrelated to bug 74127. "patch 2.0-12u10 FreeBSD" may sometimes duplicate the previous line when it should actually insert a blank line. This is reproduceable, for example, try applying the patch in bug 190195 to a checked out r242826 head tree, then compare the expected diff to the resulting diff. I believe this is due to the last line of the patch attached to bug 190195 not ending with a linefeed. Expected: [...] > "Northbridge Proximity Temperature", \ > "Wireless Module Temperature", } > #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ Seen: [...] > "Northbridge Proximity Temperature", \ > "Wireless Module Temperature", } > "Wireless Module Temperature", } #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
Hi, Review pending for this: https://reviews.freebsd.org/D12609
(In reply to Kyle Evans from comment #1) Looks good. does it also fix PR 191641 ?
(In reply to Pedro F. Giffuni from comment #2) That's this PR?
(In reply to Conrad Meyer from comment #3) Sorry .. I meant 74127, which also refers to 84816.
No, I don't see how this could fix 74127 (or 84816).
(In reply to Conrad Meyer from comment #5) Well, the patch is correct but we may be missing the big picture(TM). No one is asking Kyle to fix all the bugs in patch(1) though ;).
(In reply to Pedro F. Giffuni from comment #4) 74127 looks like a logical error elsewhere- I can poke at that sometime this upcoming week.
A commit references this bug: Author: kevans Date: Mon Oct 9 14:50:02 UTC 2017 New revision: 324431 URL: https://svnweb.freebsd.org/changeset/base/324431 Log: patch(1): Don't overrun line buffer in some cases Patches like file.txt attached to PR 190195 with a final line formed like ">(EOL)" could cause a copy past the end of the current line buffer. In the case of PR 191641, this caused a duplicate line to be copied into the resulting file. Instead of running past the end, treat it as if it were a blank line. PR: 191641 Reviewed by: cem, emaste, pfg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12609 Changes: head/usr.bin/patch/pch.c
MARKED AS SPAM
A commit references this bug: Author: kevans Date: Thu Jan 18 21:46:42 UTC 2018 New revision: 328147 URL: https://svnweb.freebsd.org/changeset/base/328147 Log: MFC r324431: patch(1): Don't overrun line buffer in some cases Patches like file.txt attached to PR 190195 with a final line formed like ">(EOL)" could cause a copy past the end of the current line buffer. In the case of PR 191641, this caused a duplicate line to be copied into the resulting file. Instead of running past the end, treat it as if it were a blank line. PR: 191641 Changes: _U stable/11/ stable/11/usr.bin/patch/pch.c