commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-645-g259e838


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-645-g259e838
Date: Sat, 30 Mar 2013 15:38:58 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=259e83899823c5d665d91edcb27da76b00d5dcdf

The branch, master has been updated
       via  259e83899823c5d665d91edcb27da76b00d5dcdf (commit)
      from  441dda65dd5aa0a97bc26ea7398d38de43dbee06 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 259e83899823c5d665d91edcb27da76b00d5dcdf
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Mar 30 17:39:11 2013 +0200

    Minor fixes.
    
    * mh/msgchk.c (checkmail): take into account various
    possible return codes.

-----------------------------------------------------------------------

Summary of changes:
 mh/msgchk.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/mh/msgchk.c b/mh/msgchk.c
index d41259b..811693b 100644
--- a/mh/msgchk.c
+++ b/mh/msgchk.c
@@ -295,14 +295,26 @@ checkmail (const char *username, int personal)
       if (notify & NOTIFY_MAIL)
        {
          mu_off_t mbsiz = 0;
+         int newmail = 0;
          
          rc = mu_mailbox_message_unseen (mbox, &recent);
-         if (rc)
+         switch (rc)
            {
+           case 0:
+             newmail = 1;
+             break;
+             
+           case MU_ERR_NOENT:
+             newmail = 0;
+             break;
+
+           default:
              if (rc != ENOSYS && rc != MU_ERR_INFO_UNAVAILABLE)
                mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_messages_unseen",
                                 mu_url_to_string (url), rc);
              rc = mu_mailbox_messages_recent (mbox, &recent);
+             if (rc == 0)
+               newmail = recent > 0;
            }
 
          if (rc)
@@ -329,11 +341,11 @@ checkmail (const char *username, int personal)
          else
            {
              if (personal)
-               mu_printf (recent ? _("You have new mail waiting") :
-                                   _("You have old mail waiting"));
+               mu_printf (newmail ? _("You have new mail waiting") :
+                                    _("You have old mail waiting"));
              else
-               mu_printf (recent ? _("%s has new mail waiting") :
-                                   _("%s has old mail waiting"), username);
+               mu_printf (newmail ? _("%s has new mail waiting") :
+                                    _("%s has old mail waiting"), username);
            }
 
          if (date_option)


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]