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-697-g22b5850


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-697-g22b5850
Date: Mon, 27 Apr 2015 15:34:12 +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=22b58503041ddd74f2919e28bcbdd08a278dccc5

The branch, master has been updated
       via  22b58503041ddd74f2919e28bcbdd08a278dccc5 (commit)
      from  645d733887b9f7663525741e874768a3e24b7301 (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 22b58503041ddd74f2919e28bcbdd08a278dccc5
Author: Sergey Poznyakoff <address@hidden>
Date:   Mon Apr 27 18:23:59 2015 +0300

    Bugfixes.
    
    Setting non-existing variable in bin/mail at the start of the session
    caused further calls to set (without arguments) to malfunction.  This
    reveiled bugs in list mapping functions.
    
    On the other hand, invoking completion after "set var=" caused bin/mail
    to coredump.
    
    * libmailutils/list/gmap.c (mu_list_gmap): Initialize rc.
    * libmailutils/list/map.c: Always initialize *res.
    * mail/mailvar.c (mailvar_list_copy): The call to mu_list_map
    does not necessarily create the list. Create it, if it doesn't.
    (mailvar_iterate_next): Redo the loop: check if there are items
    to iterate over.

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

Summary of changes:
 libmailutils/list/gmap.c |    1 +
 libmailutils/list/map.c  |    3 +--
 mail/mailvar.c           |    7 +++----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libmailutils/list/gmap.c b/libmailutils/list/gmap.c
index 0c53cb2..744ec14 100644
--- a/libmailutils/list/gmap.c
+++ b/libmailutils/list/gmap.c
@@ -38,6 +38,7 @@ mu_list_gmap (mu_list_t list, mu_list_mapper_t map, size_t 
nelem, void *data)
     return ENOMEM;
 
   i = 0;
+  rc = 0;
   for (current = list->head.next; current != &list->head;
        current = current->next)
     {
diff --git a/libmailutils/list/map.c b/libmailutils/list/map.c
index 9e7a086..290560e 100644
--- a/libmailutils/list/map.c
+++ b/libmailutils/list/map.c
@@ -79,8 +79,7 @@ mu_list_map (mu_list_t list, mu_list_mapper_t map, void 
*data, size_t nelem,
 
   rc = mu_list_gmap (list, _list_mapper, nelem, &cl);
 
-  if (cl.list)
-    *res = cl.list;
+  *res = cl.list;
   if (rc == MU_ERR_FAILURE)
     return cl.status;
   return 0;
diff --git a/mail/mailvar.c b/mail/mailvar.c
index c8f4d25..a74e721 100644
--- a/mail/mailvar.c
+++ b/mail/mailvar.c
@@ -624,11 +624,11 @@ _mailvar_symbol_to_list (int set, mu_list_t list)
 mu_list_t
 mailvar_list_copy (int set)
 {
-  mu_list_t list;
+  mu_list_t list = NULL;
   
   if (mailvar_list)
     mu_list_map (mailvar_list, mailvar_mapper, NULL, 1, &list);
-  else
+  if (!list)
     mu_list_create (&list);
   _mailvar_symbol_to_list (set, list);
   mu_list_sort (list, mailvar_varptr_comp);
@@ -649,7 +649,7 @@ mailvar_iterate_next (struct mailvar_iterator *itr)
 {
   struct mailvar_variable *vp;
 
-  do
+  while (!mu_iterator_is_done (itr->varitr))
     {
       mu_iterator_current (itr->varitr, (void**) &vp);
       mu_iterator_next (itr->varitr);
@@ -658,7 +658,6 @@ mailvar_iterate_next (struct mailvar_iterator *itr)
          && strncmp (vp->name, itr->prefix, itr->prefixlen) == 0)
        return vp->name;
     }
-  while (!mu_iterator_is_done (itr->varitr));
   return NULL;
 }
 


hooks/post-receive
-- 
GNU Mailutils



reply via email to

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