diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-02-21 15:15:57 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-02-21 15:15:57 +0200 |
commit | afce403c36eab3eecab4db52c92e87395d86ee1e (patch) | |
tree | d361184d48afefc37ccb74ac2abd5e488d4823bb | |
parent | 9f2f2247b8191614c4344dce26eb3336224eac06 (diff) | |
download | mailutils-afce403c36eab3eecab4db52c92e87395d86ee1e.tar.gz mailutils-afce403c36eab3eecab4db52c92e87395d86ee1e.tar.bz2 |
Bugfixes.
* mailbox/listlist.c (mu_list_append_list)
(mu_list_prepend_list): Initialize head.next and head.prev
if the destination list was empty.
* mailbox/freeitem.c: Include stdlib.h.
* mailbox/list.c: Minor style fix.
-rw-r--r-- | mailbox/freeitem.c | 1 | ||||
-rw-r--r-- | mailbox/list.c | 2 | ||||
-rw-r--r-- | mailbox/listlist.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/mailbox/freeitem.c b/mailbox/freeitem.c index 65dd7f9d0..c268ea455 100644 --- a/mailbox/freeitem.c +++ b/mailbox/freeitem.c @@ -19,6 +19,7 @@ #ifdef HAVE_CONFIG_H # include <config.h> #endif +#include <stdlib.h> /* Default destroy_item function. */ void diff --git a/mailbox/list.c b/mailbox/list.c index 3ba647725..f47af2577 100644 --- a/mailbox/list.c +++ b/mailbox/list.c @@ -359,7 +359,7 @@ mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata) if (list == NULL || action == NULL) return EINVAL; - status = mu_list_get_iterator(list, &itr); + status = mu_list_get_iterator (list, &itr); if (status) return status; for (mu_iterator_first (itr); !mu_iterator_is_done (itr); diff --git a/mailbox/listlist.c b/mailbox/listlist.c index af52862cc..060c724a0 100644 --- a/mailbox/listlist.c +++ b/mailbox/listlist.c @@ -107,6 +107,7 @@ mu_list_append_list (mu_list_t list, mu_list_t new_list) if (list->count == 0) { list->head = new_list->head; + list->head.next->prev = list->head.prev->next = &list->head; list->count = new_list->count; } else @@ -123,6 +124,7 @@ mu_list_prepend_list (mu_list_t list, mu_list_t new_list) if (list->count == 0) { list->head = new_list->head; + list->head.next->prev = list->head.prev->next = &list->head; list->count = new_list->count; } else |