summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2006-04-03 00:19:33 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2006-04-03 00:19:33 +0000
commitffdc4a6f4aac965d1582f47f75956962f0fc202f (patch)
tree2f0f6e99040072aab293689a8576d644e98219ba /usr.bin
parent77100efdfb5a6025b3f998e0a989c5e39ec4893f (diff)
Always leave compile buffer on first line after compilation.
Change 0->NUL while I'm here.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/grep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index ffc3cd7382d..9deffa87d00 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.26 2005/12/13 07:20:13 kjell Exp $ */
+/* $OpenBSD: grep.c,v 1.27 2006/04/03 00:19:32 kjell Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>.
* Copyright (c) 2005 Kjell Wooding <kjell@openbsd.org>.
@@ -183,6 +183,7 @@ compile(int f, int n)
return (FALSE);
curbp = bp;
compile_win = curwp = wp;
+ gotoline(FFARG, 0);
return (TRUE);
}
@@ -362,7 +363,7 @@ compile_goto_error(int f, int n)
return (FALSE);
curbp = bp;
curwp = wp;
- if (bp->b_fname[0] == 0)
+ if (bp->b_fname[0] == '\0')
readin(adjf);
gotoline(FFARG, lineno);
return (TRUE);