diff options
-rw-r--r-- | inotail.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |