summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2005-01-12 04:06:31 +0000
committerbrian <brian@FreeBSD.org>2005-01-12 04:06:31 +0000
commit336b3042682db5e8b323fe16df574b52e6a555c7 (patch)
treec01a9ece614d8084d3534fa2257a22ab110b4130 /usr.bin
parent32598ce2f6026b48b96ffb87557712bdd7a2557e (diff)
downloadFreeBSD-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')
-rw-r--r--usr.bin/tail/forward.c8
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();
OpenPOWER on IntegriCloud