From 70af721dfa52f10203eab437aa9c5939a4177c5d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 9 Sep 2020 22:42:14 +0000 Subject: [PATCH] MFC r364291: r364291 | imp | 2020-08-16 17:55:23 -0600 (Sun, 16 Aug 2020) | 33 lines Remove heuristic for dealing with trailing newlines being truncated by mailers. ... --- usr.bin/patch/pch.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index 24e3eea5f29..70051640cf0 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -587,16 +587,11 @@ another_hunk(void) len = pgets(true); p_input_line++; if (len == 0) { - if (p_max - p_end < 4) { - /* assume blank lines got chopped */ - strlcpy(buf, " \n", buf_size); - } else { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal("unexpected end of file in patch\n"); + if (repl_beginning && repl_could_be_missing) { + repl_missing = true; + goto hunk_done; } + fatal("unexpected end of file in patch\n"); } p_end++; if (p_end >= hunkmax) -- 2.45.0