summaryrefslogtreecommitdiff
path: root/inotail.c
diff options
context:
space:
mode:
Diffstat (limited to 'inotail.c')
-rw-r--r--inotail.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index a53d1e5..9b37b55 100644
--- a/inotail.c
+++ b/inotail.c
@@ -101,9 +101,13 @@ static inline char *pretty_name(char *filename)
static void write_header(char *filename)
{
static unsigned short first_file = 1;
+ static char *last = NULL;
+
+ if (last != filename)
+ fprintf(stdout, "%s==> %s <==\n", (first_file ? "" : "\n"), pretty_name(filename));
- fprintf(stdout, "%s==> %s <==\n", (first_file ? "" : "\n"), pretty_name(filename));
first_file = 0;
+ last = filename;
}
static off_t lines_to_offset_from_end(struct file_struct *f, unsigned int n_lines)