svn commit: r320084 - stable/11/usr.bin/patch
Pedro F. Giffuni
pfg at FreeBSD.org
Sun Jun 18 21:46:55 UTC 2017
Author: pfg
Date: Sun Jun 18 21:46:54 2017
New Revision: 320084
URL: https://svnweb.freebsd.org/changeset/base/320084
Log:
MFC r319676:
patch: if reading fails, do not go into infinite loop asking for a filename.
This can happen if no tty is available.
Obtained from: OpenBSD (CVS rev 1.54)
Approved by: re (marius)
Modified:
stable/11/usr.bin/patch/pch.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/usr.bin/patch/pch.c
==============================================================================
--- stable/11/usr.bin/patch/pch.c Sun Jun 18 21:03:53 2017 (r320083)
+++ stable/11/usr.bin/patch/pch.c Sun Jun 18 21:46:54 2017 (r320084)
@@ -216,8 +216,10 @@ there_is_another_patch(void)
filearg[0] = fetchname(buf, &exists, 0);
}
if (!exists) {
- ask("No file found--skip this patch? [n] ");
- if (*buf != 'y')
+ int def_skip = *bestguess == '\0';
+ ask("No file found--skip this patch? [%c] ",
+ def_skip ? 'y' : 'n');
+ if (*buf == 'n' || (!def_skip && *buf != 'y'))
continue;
if (verbose)
say("Skipping patch...\n");
More information about the svn-src-stable
mailing list