* libmisc/mail.c: Added brackets and parenthesis.

* libmisc/mail.c: Avoid assignments in comparisons.
This commit is contained in:
nekral-guest 2008-08-30 18:31:56 +00:00
parent 7bbaec8fed
commit cf4aea18b4
2 changed files with 16 additions and 5 deletions

View File

@ -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>
* NEWS: Added support for uclibc.

View File

@ -47,8 +47,9 @@ void mailcheck (void)
struct stat statbuf;
char *mailbox;
if (!getdef_bool ("MAIL_CHECK_ENAB"))
if (!getdef_bool ("MAIL_CHECK_ENAB")) {
return;
}
/*
* Check incoming mail in Maildir format - J.
@ -69,13 +70,18 @@ void mailcheck (void)
free (newmail);
}
if (!(mailbox = getenv ("MAIL")))
mailbox = getenv ("MAIL");
if (NULL == mailbox) {
return;
}
if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0)
if ( (stat (mailbox, &statbuf) == -1)
|| (statbuf.st_size == 0)) {
puts (_("No mail."));
else if (statbuf.st_atime > statbuf.st_mtime)
} else if (statbuf.st_atime > statbuf.st_mtime) {
puts (_("You have mail."));
else
} else {
puts (_("You have new mail."));
}
}