summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/grep/util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 785961b..447e8c5 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -246,9 +246,9 @@ procfile(const char *fn)
printf("%u\n", c);
}
if (lflag && !qflag && c != 0)
- printf("%s\n", fn);
+ printf("%s%c", fn, nullflag ? 0 : '\n');
if (Lflag && !qflag && c == 0)
- printf("%s\n", fn);
+ printf("%s%c", fn, nullflag ? 0 : '\n');
if (c && !cflag && !lflag && !Lflag &&
binbehave == BINFILE_BIN && f->binary && !qflag)
printf(getstr(8), fn);
@@ -440,13 +440,13 @@ printline(struct str *line, int sep, regmatch_t *matches, int m)
int i, n = 0;
if (!hflag) {
- if (nullflag == 0)
+ if (!nullflag) {
fputs(line->file, stdout);
- else {
+ ++n;
+ } else {
printf("%s", line->file);
putchar(0);
}
- ++n;
}
if (nflag) {
if (n > 0)
OpenPOWER on IntegriCloud