svn commit: r365535 - stable/12/usr.bin/patch

Warner Losh imp at FreeBSD.org
Wed Sep 9 22:42:15 UTC 2020


Author: imp
Date: Wed Sep  9 22:42:14 2020
New Revision: 365535
URL: https://svnweb.freebsd.org/changeset/base/365535

Log:
  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.
  ...

Modified:
  stable/12/usr.bin/patch/pch.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/patch/pch.c
==============================================================================
--- stable/12/usr.bin/patch/pch.c	Wed Sep  9 22:40:39 2020	(r365534)
+++ stable/12/usr.bin/patch/pch.c	Wed Sep  9 22:42:14 2020	(r365535)
@@ -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)


More information about the svn-src-stable mailing list