From: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 25 Aug 2005 19:11:53 +0000 (19:11 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 25 Aug 2005 19:11:53 +0000 (19:11 +0000)
Rocco Rutte:
- strip $folder prefix from items in sidebar before doing basename()

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@443 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
sidebar.c

index 18e1dd6..6a13cf6 100644 (file)
@@ -1 +1 @@
-442
+443
index bdfcd6d..ba4d4a4 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -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) {