diff options
author | 2003-07-31 14:10:21 +0000 | |
---|---|---|
committer | 2003-07-31 14:10:21 +0000 | |
commit | da07b79cbcb45d76e5e978e961d2d6fe2407abe5 (patch) | |
tree | e5ada01303c0ec5729231b74e31b8bc84a480d28 /usr.bin/patch/inp.c | |
parent | We no longer use GNU diffutils; don't tell rcs we do... (diff) | |
download | wireguard-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.c | 9 |
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) |