]> granicus.if.org Git - neomutt/commitdiff
mutt_str_startswith - imap/util.c
authorPietro Cerutti <gahr@gahr.ch>
Fri, 9 Nov 2018 15:11:13 +0000 (15:11 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 14 Nov 2018 15:10:31 +0000 (15:10 +0000)
imap/util.c

index c64c39023054d92b1deed808d4cda13de6dfd6e1..fab80de94ba79aba82af3e65b2e8c8846d3aa834 100644 (file)
@@ -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;