X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=browser.c;h=57cdbb17a0a5947b99cabcb2532c27f36de3ada7;hb=1dc7032b59cc5b91d70076ed228bda8caf65a7f3;hp=5baa3b78c6af4edfea0dd4ae030b010ea3a5f8ac;hpb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c;p=apps%2Fmadmutt.git diff --git a/browser.c b/browser.c index 5baa3b7..57cdbb1 100644 --- a/browser.c +++ b/browser.c @@ -12,6 +12,7 @@ #endif #include +#include #include "mutt.h" #include "enter.h" @@ -33,8 +34,6 @@ #endif #include "sidebar.h" -#include "lib/mem.h" -#include "lib/intl.h" #include "lib/str.h" #include "lib/list.h" @@ -429,21 +428,17 @@ static void add_folder (MUTTMENU * m, struct browser_state *state, { if (state->entrylen == state->entrymax) { /* need to allocate more space */ - mem_realloc (&state->entry, - sizeof (struct folder_file) * (state->entrymax += 256)); - memset (&state->entry[state->entrylen], 0, - sizeof (struct folder_file) * 256); + p_realloc(&state->entry, state->entrymax += 256); + p_clear(&state->entry[state->entrylen], 256); if (m) m->data = state->entry; } if (s != NULL) { - (state->entry)[state->entrylen].mode = s->st_mode; + (state->entry)[state->entrylen].mode = s->st_mode; (state->entry)[state->entrylen].mtime = s->st_mtime; - (state->entry)[state->entrylen].size = s->st_size; - - (state->entry)[state->entrylen].st = p_new(struct stat, 1); - memcpy ((state->entry)[state->entrylen].st, s, sizeof (struct stat)); + (state->entry)[state->entrylen].size = s->st_size; + (state->entry)[state->entrylen].st = p_dup(s, 1); } (state->entry)[state->entrylen].new = new;