summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-01-28 08:31:08 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-01-28 08:31:08 +0000
commit30057f9126e97dabcbf6fbda2fda183a132c35b6 (patch)
tree87e98444fdb1b14dbca95c6f36f405577abcf828 /usr.bin
parent859cc0514a587cade80ea9b71656d0996be80428 (diff)
Fix a segv when patch cannot find a file and the user indicates
to use the file anyway. Problem found by david@ ok david@ millert@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/patch/pch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index 7227d466499..55c6e725a47 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pch.c,v 1.32 2003/10/31 20:20:45 millert Exp $ */
+/* $OpenBSD: pch.c,v 1.33 2004/01/28 08:31:07 otto Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: pch.c,v 1.32 2003/10/31 20:20:45 millert Exp $";
+static const char rcsid[] = "$OpenBSD: pch.c,v 1.33 2004/01/28 08:31:07 otto Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -228,12 +228,12 @@ there_is_another_patch(void)
filearg[0] = fetchname(buf, &exists, 0);
}
if (!exists) {
- free(filearg[0]);
ask("No file found--skip this patch? [n] ");
if (*buf != 'y')
continue;
if (verbose)
say("Skipping patch...\n");
+ free(filearg[0]);
filearg[0] = fetchname(bestguess, &exists, 0);
skip_rest_of_patch = true;
return true;