From: Kevin McCarthy Date: Sun, 16 Oct 2016 22:44:17 +0000 (-0700) Subject: Change sidebar to only match $folder prefix on a $sidebar_divider_char. (closes ... X-Git-Tag: neomutt-20161028~1^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0640ab75bf69424486e2b61ae7ac91f703be00a3;p=neomutt 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. --- diff --git a/sidebar.c b/sidebar.c index fb758170c..3596fec82 100644 --- a/sidebar.c +++ b/sidebar.c @@ -661,7 +661,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 */