1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

Mail counter fixes.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@604 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-13 22:02:32 +00:00 committed by cras
parent 1e7d7490f6
commit 1e88ec7dcd

View File

@ -593,17 +593,24 @@ static int get_mail_count(void)
int count;
fname = g_getenv("MAIL");
if (stat(fname, &statbuf) != 0)
if (stat(fname, &statbuf) != 0) {
mail_last_mtime = -1;
mail_last_size = -1;
mail_last_count = 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;
if (f == NULL) {
mail_last_count = 0;
return 0;
}
count = 0;
while (fgets(str, sizeof(str), f) != NULL) {