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-514-gf9a034c


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-514-gf9a034c
Date: Fri, 09 Dec 2011 16:50:51 +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=f9a034c7af98b56f62114b4e390a9c7f5971db68

The branch, master has been updated
       via  f9a034c7af98b56f62114b4e390a9c7f5971db68 (commit)
       via  e20cd8ae1e349af0a13008c1dc31704e64658455 (commit)
      from  ada8b8cfa6957d99831c7318e572628006b1ca66 (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 f9a034c7af98b56f62114b4e390a9c7f5971db68
Author: Sergey Poznyakoff <address@hidden>
Date:   Fri Dec 9 17:29:26 2011 +0200

    Make sure mu_mailbox_get_message returns MU_ERR_NOENT if the requested 
message number is not found in the mailbox.
    
    * libmailutils/base/amd.c (amd_get_message): Return MU_ERR_NOENT if
    msgno is not found in the mailbox, but not if it is 0, in which case
    return EINVAL.
    * libproto/mbox/mbox.c (mbox_get_message): Likewise.
    * libproto/pop/mbox.c (pop_create_pop3_message): Likewise.
    
    * libproto/mbox/mboxscan.c (mbox_scan_internal): Fix calculation of UIDs.

commit e20cd8ae1e349af0a13008c1dc31704e64658455
Author: Sergey Poznyakoff <address@hidden>
Date:   Fri Dec 9 17:27:23 2011 +0200

    Bugfix in mu_list_sort.
    
    * libmailutils/list/sort.c (_list_qsort): Fix end-of-list condition.

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

Summary of changes:
 libmailutils/base/amd.c        |    4 ++--
 libmailutils/list/sort.c       |    2 +-
 libmailutils/mailbox/mailbox.c |    2 +-
 libproto/mbox/mbox.c           |    4 ++--
 libproto/mbox/mboxscan.c       |   10 +++++-----
 libproto/pop/mbox.c            |    2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libmailutils/base/amd.c b/libmailutils/base/amd.c
index 769d9c5..af2c3cf 100644
--- a/libmailutils/base/amd.c
+++ b/libmailutils/base/amd.c
@@ -723,7 +723,7 @@ amd_get_message (mu_mailbox_t mailbox, size_t msgno, 
mu_message_t *pmsg)
   /* Sanity checks.  */
   if (pmsg == NULL)
     return MU_ERR_OUT_PTR_NULL;
-  if (amd == NULL)
+  if (amd == NULL || msgno < 1)
     return EINVAL;
 
   /* If we did not start a scanning yet do it now.  */
@@ -735,7 +735,7 @@ amd_get_message (mu_mailbox_t mailbox, size_t msgno, 
mu_message_t *pmsg)
     }
 
   if ((mhm = _amd_get_message (amd, msgno)) == NULL)
-    return EINVAL;
+    return MU_ERR_NOENT;
   return _amd_attach_message (mailbox, mhm, pmsg);
 }
 
diff --git a/libmailutils/list/sort.c b/libmailutils/list/sort.c
index a021abb..fef4f6f 100644
--- a/libmailutils/list/sort.c
+++ b/libmailutils/list/sort.c
@@ -65,7 +65,7 @@ _list_qsort (mu_list_t list, mu_list_comparator_t cmp)
   cur = list->head.next;
   do {
     cur = cur->next;
-    if (!cur)
+    if (cur == &list->head)
       return;
   } while ((rc = cmp (list->head.next->item, cur->item)) == 0);
 
diff --git a/libmailutils/mailbox/mailbox.c b/libmailutils/mailbox/mailbox.c
index e25ded3..a31682a 100644
--- a/libmailutils/mailbox/mailbox.c
+++ b/libmailutils/mailbox/mailbox.c
@@ -840,7 +840,7 @@ _search_message_uid (mu_mailbox_t mbox, size_t uid, size_t 
*result)
   return _uid_bsearch (mbox, 1, count, uid, result);
 }
 
-/* Translat message UIDs to message numbers and vice versa. */
+/* Translate message UIDs to message numbers and vice versa. */
 int
 mu_mailbox_translate (mu_mailbox_t mbox, int cmd, size_t from, size_t *to)
 {
diff --git a/libproto/mbox/mbox.c b/libproto/mbox/mbox.c
index 559a480..5fcf4cf 100644
--- a/libproto/mbox/mbox.c
+++ b/libproto/mbox/mbox.c
@@ -591,7 +591,7 @@ mbox_get_message (mu_mailbox_t mailbox, size_t msgno, 
mu_message_t *pmsg)
   /* Sanity checks.  */
   if (pmsg == NULL)
     return MU_ERR_OUT_PTR_NULL;
-  if (mud == NULL)
+  if (mud == NULL || msgno < 1)
     return EINVAL;
 
   /* If we did not start a scanning yet do it now.  */
@@ -606,7 +606,7 @@ mbox_get_message (mu_mailbox_t mailbox, size_t msgno, 
mu_message_t *pmsg)
   if (!(mud->messages_count > 0
        && msgno > 0
        && msgno <= mud->messages_count))
-    return EINVAL;
+    return MU_ERR_NOENT;
 
   mum = mud->umessages[msgno - 1];
 
diff --git a/libproto/mbox/mboxscan.c b/libproto/mbox/mboxscan.c
index 7492c8e..4fcceea 100644
--- a/libproto/mbox/mboxscan.c
+++ b/libproto/mbox/mboxscan.c
@@ -320,7 +320,7 @@ mbox_scan_internal (mu_mailbox_t mailbox, mbox_message_t 
mum,
   int newline;
   size_t n = 0;
   mu_stream_t stream;
-  size_t min_uid = 1;
+  size_t min_uid = 0;
   int zn, isfrom = 0;
   char *temp;
   
@@ -367,9 +367,9 @@ mbox_scan_internal (mu_mailbox_t mailbox, mbox_message_t 
mum,
                  mum->body_end = total - n - newline;
                  mum->body_lines = --lines - newline;
 
-                 if (mum->uid < min_uid)
+                 if (mum->uid <= min_uid)
                    {
-                     mum->uid = min_uid++;
+                     mum->uid = ++min_uid;
                      /* Note that modification for when expunging.  */
                      mum->attr_flags |= MU_ATTRIBUTE_MODIFIED;
                    }
@@ -451,9 +451,9 @@ mbox_scan_internal (mu_mailbox_t mailbox, mbox_message_t 
mum,
       mum->body_end = total - newline;
       mum->body_lines = lines - newline;
 
-      if (mum->uid < min_uid)
+      if (mum->uid <= min_uid)
        {
-         mum->uid = min_uid++;
+         mum->uid = ++min_uid;
          /* Note that modification for when expunging.  */
          mum->attr_flags |= MU_ATTRIBUTE_MODIFIED;
        }
diff --git a/libproto/pop/mbox.c b/libproto/pop/mbox.c
index ba03ef2..1b64247 100644
--- a/libproto/pop/mbox.c
+++ b/libproto/pop/mbox.c
@@ -604,7 +604,7 @@ pop_create_pop3_message (struct _pop3_mailbox *mpd, size_t 
msgno,
   struct _pop3_message *mpm;
   
   if (msgno > mpd->msg_count)
-    return EINVAL;
+    return MU_ERR_NOENT;
 
   if (!mpd->msg)
     {


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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