X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=buffy.c;h=7688aa4befc3cac8fcb56e47b1e9ccd2e52c6535;hb=23002a877577341cfd68687e58348e0ca01b1ac5;hp=f1b39b38070e99ee44ef592e84e123e8e427074b;hpb=642a770d749788adac51935945426ae3846da226;p=apps%2Fmadmutt.git diff --git a/buffy.c b/buffy.c index f1b39b3..7688aa4 100644 --- a/buffy.c +++ b/buffy.c @@ -14,6 +14,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "buffy.h" #include "buffer.h" @@ -170,8 +172,8 @@ void buffy_update_mailbox (BUFFY * b) /* func to free buffy for list_del() */ static void buffy_free (BUFFY** p) { - mem_free(&(*p)->path); - mem_free(p); + p_delete(&(*p)->path); + p_delete(p); } int buffy_lookup (const char* path) { @@ -220,7 +222,7 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data, } if (i < 0) { - tmp = mem_calloc (1, sizeof (BUFFY)); + tmp = p_new(BUFFY, 1); tmp->path = str_dup (buf); tmp->magic = 0; list_push_back (&Incoming, tmp); @@ -390,10 +392,11 @@ int buffy_check (int force) /* one new and undeleted message is enough */ if (tmp->new == 0) { BuffyCount++; - tmp->new = 1; - if (!count) + if (!count) { /* if sidebar invisible -> done */ + tmp->new = 1; break; + } } tmp->msgcount++; tmp->msg_unread++;