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

index c5bbabb4a93eae5c043854a8eb43eb05e5f1ca93..3f630616bee4b08f950b40480d83720a3320a3a9 100644 (file)
@@ -365,23 +365,23 @@ int mutt_get_postponed(struct Context *ctx, struct Email *hdr,
       code |= SEND_POSTPONED_FCC;
     }
     else if (((WithCrypto & APPLICATION_PGP) != 0) &&
-             ((mutt_str_strncmp("Pgp:", np->data, 4) == 0) /* this is generated
-                                                        * by old neomutt versions
-                                                        */
-              || (mutt_str_strncmp("X-Mutt-PGP:", np->data, 11) == 0)))
+             /* this is generated by old neomutt versions */
+             (mutt_str_startswith(np->data, "Pgp:", CASE_MATCH) ||
+              /* this is the new way */
+              mutt_str_startswith(np->data, "X-Mutt-PGP:", CASE_MATCH)))
     {
       hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_PGP);
       hdr->security |= APPLICATION_PGP;
     }
     else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
-             (mutt_str_strncmp("X-Mutt-SMIME:", np->data, 13) == 0))
+             mutt_str_startswith(np->data, "X-Mutt-SMIME:", CASE_MATCH))
     {
       hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_SMIME);
       hdr->security |= APPLICATION_SMIME;
     }
 
 #ifdef MIXMASTER
-    else if (mutt_str_strncmp("X-Mutt-Mix:", np->data, 11) == 0)
+    else if (mutt_str_startswith(np->data, "X-Mutt-Mix:", CASE_MATCH))
     {
       mutt_list_free(&hdr->chain);