]> granicus.if.org Git - mutt/commitdiff
Change sidebar to only match $folder prefix on a $sidebar_divider_char. (closes ...
authorKevin McCarthy <kevin@8t8.us>
Sun, 16 Oct 2016 22:44:17 +0000 (15:44 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 16 Oct 2016 22:44:17 +0000 (15:44 -0700)
The reporter had a $spoolfile of ~/Mailbox and a $folder of ~/Mail.
The sidebar was truncating the spoolfile to "ox" because it only
looked at a substring prefix match.

sidebar.c

index 77a2a03b24a3b016ccc2b889085b609ac1b9507d..b8e699314283b250f4bfed87eca0a7219bb44980 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -595,7 +595,10 @@ static void draw_sidebar (int num_rows, int num_cols, int div_width)
 
     /* check whether Maildir is a prefix of the current folder's path */
     short maildir_is_prefix = 0;
-    if ((mutt_strlen (b->path) > maildirlen) && (mutt_strncmp (Maildir, b->path, maildirlen) == 0))
+    if ((mutt_strlen (b->path) > maildirlen) &&
+        (mutt_strncmp (Maildir, b->path, maildirlen) == 0) &&
+        SidebarDelimChars &&
+        strchr (SidebarDelimChars, b->path[maildirlen]))
       maildir_is_prefix = 1;
 
     /* calculate depth of current folder and generate its display name with indented spaces */