From: Pietro Cerutti Date: Fri, 9 Nov 2018 17:00:27 +0000 (+0000) Subject: mutt_str_startswith - ncrypt/crypt.c X-Git-Tag: 2019-10-25~532^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1ec397652cc7ae651769c81df09b2f863809e24;p=neomutt mutt_str_startswith - ncrypt/crypt.c --- diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 4f8cc265e..afaf039a4 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -545,13 +545,13 @@ int mutt_is_application_pgp(struct Body *m) if (((p = mutt_param_get(&m->parameter, "x-mutt-action")) || (p = mutt_param_get(&m->parameter, "x-action")) || (p = mutt_param_get(&m->parameter, "action"))) && - (mutt_str_strncasecmp("pgp-sign", p, 8) == 0)) + mutt_str_startswith(p, "pgp-sign", CASE_IGNORE)) { t |= PGP_SIGN; } - else if (p && (mutt_str_strncasecmp("pgp-encrypt", p, 11) == 0)) + else if (p && mutt_str_startswith(p, "pgp-encrypt", CASE_IGNORE)) t |= PGP_ENCRYPT; - else if (p && (mutt_str_strncasecmp("pgp-keys", p, 7) == 0)) + else if (p && mutt_str_startswith(p, "pgp-keys", CASE_IGNORE)) t |= PGP_KEY; } if (t) @@ -1226,7 +1226,7 @@ const char *crypt_get_fingerprint_or_id(char *p, const char **pphint, * condition of the caller. */ char *pf = mutt_str_skip_whitespace(p); - if (mutt_str_strncasecmp(pf, "0x", 2) == 0) + if (mutt_str_startswith(pf, "0x", CASE_IGNORE)) pf += 2; /* Check if a fingerprint is given, must be hex digits only, blanks