* libmisc/mail.c: Added brackets and parenthesis.
* libmisc/mail.c: Avoid assignments in comparisons.
This commit is contained in:
parent
7bbaec8fed
commit
cf4aea18b4
@ -1,3 +1,8 @@
|
|||||||
|
2008-08-26 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* libmisc/mail.c: Added brackets and parenthesis.
|
||||||
|
* libmisc/mail.c: Avoid assignments in comparisons.
|
||||||
|
|
||||||
2008-08-26 Tobias <tp@fonz.de>
|
2008-08-26 Tobias <tp@fonz.de>
|
||||||
|
|
||||||
* NEWS: Added support for uclibc.
|
* NEWS: Added support for uclibc.
|
||||||
|
@ -47,8 +47,9 @@ void mailcheck (void)
|
|||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
char *mailbox;
|
char *mailbox;
|
||||||
|
|
||||||
if (!getdef_bool ("MAIL_CHECK_ENAB"))
|
if (!getdef_bool ("MAIL_CHECK_ENAB")) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check incoming mail in Maildir format - J.
|
* Check incoming mail in Maildir format - J.
|
||||||
@ -69,13 +70,18 @@ void mailcheck (void)
|
|||||||
free (newmail);
|
free (newmail);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mailbox = getenv ("MAIL")))
|
mailbox = getenv ("MAIL");
|
||||||
|
if (NULL == mailbox) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0)
|
if ( (stat (mailbox, &statbuf) == -1)
|
||||||
|
|| (statbuf.st_size == 0)) {
|
||||||
puts (_("No mail."));
|
puts (_("No mail."));
|
||||||
else if (statbuf.st_atime > statbuf.st_mtime)
|
} else if (statbuf.st_atime > statbuf.st_mtime) {
|
||||||
puts (_("You have mail."));
|
puts (_("You have mail."));
|
||||||
else
|
} else {
|
||||||
puts (_("You have new mail."));
|
puts (_("You have new mail."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user