changeset: 6822:18c3db1aa8c4
user:      Kevin McCarthy <ke...@8t8.us>
date:      Sun Oct 16 15:44:17 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/18c3db1aa8c4

Change sidebar to only match $folder prefix on a $sidebar_divider_char. (closes 
#3887)

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.

diffs (15 lines):

diff -r 7e174b2fcbe1 -r 18c3db1aa8c4 sidebar.c
--- a/sidebar.c Sun Oct 16 15:14:32 2016 -0700
+++ b/sidebar.c Sun Oct 16 15:44:17 2016 -0700
@@ -595,7 +595,10 @@
 
     /* 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 */

Reply via email to