Andreas Krennmair:
authorak1 <ak1@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 15 Sep 2005 19:30:48 +0000 (19:30 +0000)
committerak1 <ak1@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 15 Sep 2005 19:30:48 +0000 (19:30 +0000)
correctly handle Maildir with and without trailing slash when printing sidebar entries.

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

VERSION.svn
sidebar.c

index 678dee3..9dbddfa 100644 (file)
@@ -1 +1 @@
-527
+528
index 57043ba..4ea49d4 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -217,9 +217,12 @@ int make_sidebar_entry (char* box, int idx, size_t len)
   else
 #endif
   if (l_m > 0 && str_ncmp (box, Maildir, l_m) == 0 && 
-      str_len (box) > l_m)
+      str_len (box) > l_m) {
     box += l_m;
-  else
+    if (Maildir[strlen(Maildir)-1]!='/') {
+      box += 1;
+    }
+  } else
     box = basename (box);
 
   if (option (OPTSHORTENHIERARCHY) && str_len (box) > len-lencnt-1) {