From: Pietro Cerutti Date: Fri, 9 Nov 2018 15:11:13 +0000 (+0000) Subject: mutt_str_startswith - imap/util.c X-Git-Tag: 2019-10-25~532^2~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=559259c7e2806913b5b6733b6a8d16b92e203fa9;p=neomutt mutt_str_startswith - imap/util.c --- diff --git a/imap/util.c b/imap/util.c index c64c39023..fab80de94 100644 --- a/imap/util.c +++ b/imap/util.c @@ -601,7 +601,7 @@ int imap_parse_path(const char *path, struct ImapMbox *mx) mx->account.flags |= MUTT_ACCT_PORT; if (sscanf(tmp, "/%s", tmp) == 1) { - if (mutt_str_strncmp(tmp, "ssl", 3) == 0) + if (mutt_str_startswith(tmp, "ssl", CASE_MATCH)) mx->account.flags |= MUTT_ACCT_SSL; else { @@ -684,7 +684,7 @@ void imap_pretty_mailbox(char *path, const char *folder) { hlen = mutt_str_strlen(home.mbox); if (tlen && mutt_account_match(&home.account, &target.account) && - (mutt_str_strncmp(home.mbox, target.mbox, hlen) == 0)) + (hlen == 0 || mutt_str_startswith(target.mbox, home.mbox, CASE_MATCH))) { if (hlen == 0) home_match = true;