X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sidebar.c;h=ba4d4a49a2b965fbdb60177ad05981c7f95e1635;hp=5df3fd80da06a5e7112d0f88718b9c7e239e24c5;hb=b85f52d2ec4d820ab5c4b577857548bec294bb27;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/sidebar.c b/sidebar.c index 5df3fd8..ba4d4a4 100644 --- a/sidebar.c +++ b/sidebar.c @@ -79,7 +79,7 @@ static char *shortened_hierarchy (char *box, int maxlen) if (last_dot) { ++last_dot; - new_box = safe_malloc (maxlen + 1); + new_box = mem_malloc (maxlen + 1); new_box[0] = box[0]; for (i = 1, j = 1; j < maxlen && i < len; ++i) { if (strchr (SidebarBoundary, box[i])) { @@ -189,6 +189,7 @@ int make_sidebar_entry (char* box, int idx, size_t len) #if USE_IMAP int l = str_len (ImapHomeNamespace); #endif + int l_m = str_len (Maildir); if (SidebarWidth > COLS) SidebarWidth = COLS; @@ -211,6 +212,10 @@ int make_sidebar_entry (char* box, int idx, size_t len) box += l + 1; else #endif + if (l_m > 0 && str_ncmp (box, Maildir, l_m) == 0 && + str_len (box) > l_m) + box += l_m + 1; + else box = basename (box); if (option (OPTSHORTENHIERARCHY) && str_len (box) > len-lencnt-1) { @@ -225,7 +230,7 @@ int make_sidebar_entry (char* box, int idx, size_t len) addnstr (entry, len); if (shortened) - FREE(&box); + mem_free(&box); return (1); }