diff options
author | brian <brian@FreeBSD.org> | 2005-01-12 04:06:31 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2005-01-12 04:06:31 +0000 |
commit | 336b3042682db5e8b323fe16df574b52e6a555c7 (patch) | |
tree | c01a9ece614d8084d3534fa2257a22ab110b4130 /usr.bin/tail | |
parent | 32598ce2f6026b48b96ffb87557712bdd7a2557e (diff) | |
download | FreeBSD-src-336b3042682db5e8b323fe16df574b52e6a555c7.zip FreeBSD-src-336b3042682db5e8b323fe16df574b52e6a555c7.tar.gz |
Don't reprint file names unnecessarily.
PR: 75028
Submitted by: mteterin at 250-217 dot customer dot cloud9 dot net
MFC after: 7 days
Diffstat (limited to 'usr.bin/tail')
-rw-r--r-- | usr.bin/tail/forward.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 13f9d79..0d9ff8d 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -246,13 +246,13 @@ rlines(fp, off, sbp) static void show(file_info_t *file) { - int ch, first; + int ch; + static file_info_t *last; - first = 1; while ((ch = getc(file->fp)) != EOF) { - if (first && no_files > 1) { + if (last != file && no_files > 1) { (void)printf("\n==> %s <==\n", file->file_name); - first = 0; + last = file; } if (putchar(ch) == EOF) oerr(); |