summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2003-07-31 14:10:21 +0000
committerotto <otto@openbsd.org>2003-07-31 14:10:21 +0000
commitda07b79cbcb45d76e5e978e961d2d6fe2407abe5 (patch)
treee5ada01303c0ec5729231b74e31b8bc84a480d28 /usr.bin/patch/inp.c
parentWe no longer use GNU diffutils; don't tell rcs we do... (diff)
downloadwireguard-openbsd-da07b79cbcb45d76e5e978e961d2d6fe2407abe5.tar.xz
wireguard-openbsd-da07b79cbcb45d76e5e978e961d2d6fe2407abe5.zip
Print a maximum of one invalid line number warning per patch in a patch file.
Thanks to espie@ for spotting the problem. ok millert@ henning@ espie@
Diffstat (limited to 'usr.bin/patch/inp.c')
-rw-r--r--usr.bin/patch/inp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index 9e81fd9b2be..77ad4b66cb3 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: inp.c,v 1.20 2003/07/28 19:15:34 deraadt Exp $ */
+/* $OpenBSD: inp.c,v 1.21 2003/07/31 14:10:21 otto Exp $ */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: inp.c,v 1.20 2003/07/28 19:15:34 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: inp.c,v 1.21 2003/07/31 14:10:21 otto Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -329,7 +329,10 @@ char *
ifetch(LINENUM line, int whichbuf)
{
if (line < 1 || line > input_lines) {
- say("No such line %ld in input file, ignoring\n", line);
+ if (warn_on_invalid_line) {
+ say("No such line %ld in input file, ignoring\n", line);
+ warn_on_invalid_line = FALSE;
+ }
return NULL;
}
if (using_plan_a)