From 8c6bfaac6ab061404f67e3769b3e15360aa80d6a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 30 Jul 2000 20:15:48 +0000 Subject: [PATCH] Mail check: the also file size changes as well as modify time changes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@554 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/statusbar-items.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index c33cf372..7ea0e6dc 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -82,7 +82,8 @@ static time_t lag_last_draw; /* mbox counter */ static SBAR_ITEM_REC *mail_item; static int mail_timetag, mail_last_count; -static time_t mail_last_mtime; +static time_t mail_last_mtime = -1; +static off_t mail_last_size = -1; /* topic */ static SBAR_ITEM_REC *topic_item; @@ -595,9 +596,11 @@ static int get_mail_count(void) if (stat(fname, &statbuf) != 0) return 0; - if (statbuf.st_mtime == mail_last_mtime) + if (statbuf.st_mtime == mail_last_mtime || + statbuf.st_size == mail_last_size) return mail_last_count; mail_last_mtime = statbuf.st_mtime; + mail_last_size = statbuf.st_size; f = fopen(fname, "r"); if (f == NULL) return 0;