summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>1999-08-31 21:29:19 +0000
committerespie <espie@openbsd.org>1999-08-31 21:29:19 +0000
commit444ae62b58c3f7b04e9bc222bfcdb7a313253efd (patch)
tree4d54e37dcfb878ca62e4d45ffa7f429da3850b10 /usr.bin/patch/patch.c
parentpull in ioccom.h because apps exist which do not pull in ioctl.h first; steuck@iname.com (diff)
downloadwireguard-openbsd-444ae62b58c3f7b04e9bc222bfcdb7a313253efd.tar.xz
wireguard-openbsd-444ae62b58c3f7b04e9bc222bfcdb7a313253efd.zip
patch file should hold at least one patch, otherwise we're entitled to
a diagnostic.
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 3fd24810bc4..c9e401afd79 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.11 1998/11/25 00:30:26 espie Exp $ */
+/* $OpenBSD: patch.c,v 1.12 1999/08/31 21:29:19 espie Exp $ */
/* patch - a program to apply diffs to original files
*
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: patch.c,v 1.11 1998/11/25 00:30:26 espie Exp $";
+static char rcsid[] = "$OpenBSD: patch.c,v 1.12 1999/08/31 21:29:19 espie Exp $";
#endif /* not lint */
#include "INTERN.h"
@@ -68,6 +68,7 @@ char **argv;
int hunk = 0;
int failed = 0;
int failtotal = 0;
+ int patch_seen = 0;
int i;
setbuf(stderr, serrbuf);
@@ -144,6 +145,7 @@ char **argv;
there_is_another_patch();
reinitialize_almost_everything()
) { /* for each patch in patch file */
+ patch_seen = TRUE;
if (outname == Nullch)
outname = savestr(filearg[0]);
@@ -338,6 +340,8 @@ char **argv;
}
set_signals(1);
}
+ if (!patch_seen)
+ failtotal++;
my_exit(failtotal);
/* NOTREACHED */
}