From a388cbe15a5b0d42300f53eb50792250bff75348 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Fri, 9 Nov 2018 15:10:31 +0000 Subject: [PATCH] mutt_str_startswith - imap/browse.c --- imap/browse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imap/browse.c b/imap/browse.c index c9463c9fa..a08a85126 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -80,7 +80,7 @@ static void add_folder(char delim, char *folder, bool noselect, bool noinferiors if (isparent) mutt_str_strfcpy(relpath, "../", sizeof(relpath)); /* strip current folder from target, to render a relative path */ - else if (mutt_str_strncmp(mx.mbox, folder, mutt_str_strlen(mx.mbox)) == 0) + else if (mutt_str_startswith(folder, mx.mbox, CASE_MATCH)) mutt_str_strfcpy(relpath, folder + mutt_str_strlen(mx.mbox), sizeof(relpath)); else mutt_str_strfcpy(relpath, folder, sizeof(relpath)); @@ -170,7 +170,7 @@ static int browse_add_list_result(struct ImapAccountData *adata, const char *cmd if (isparent) list.noselect = true; /* prune current folder from output */ - if (isparent || (mutt_str_strncmp(list.name, mx.mbox, strlen(list.name)) != 0)) + if (isparent || !mutt_str_startswith(mx.mbox, list.name, CASE_MATCH)) add_folder(list.delim, list.name, list.noselect, list.noinferiors, state, isparent); } } while (rc == IMAP_CMD_CONTINUE); -- 2.40.0