From 0640ab75bf69424486e2b61ae7ac91f703be00a3 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sun, 16 Oct 2016 15:44:17 -0700 Subject: [PATCH] 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. --- sidebar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- 2.40.0