summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/pch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index 46e5414fc6e..dcf7b414189 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pch.c,v 1.54 2015/10/16 07:33:47 tobias Exp $ */
+/* $OpenBSD: pch.c,v 1.55 2016/09/02 09:48:03 otto Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -225,8 +225,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");