From c9961756c79f8f8ab54c36a058619117575a7d00 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Fri, 4 Aug 2017 15:54:44 +0100 Subject: [PATCH] Remove ascii_* functions (#700) Issue #699 --- account.c | 2 +- addrbook.c | 2 +- alias.c | 6 +- attach.c | 8 +-- charset.c | 18 ++--- color.c | 18 ++--- commands.c | 4 +- copy.c | 56 +++++++-------- from.c | 2 +- handler.c | 44 ++++++------ headers.c | 6 +- imap/auth.c | 2 +- imap/auth_sasl.c | 2 +- imap/command.c | 50 +++++++------- imap/imap.c | 24 +++---- imap/message.c | 40 +++++------ imap/util.c | 6 +- init.c | 44 ++++++------ keymap.c | 6 +- lib/Makefile.am | 4 +- lib/ascii.c | 119 -------------------------------- lib/ascii.h | 34 ---------- lib/lib.h | 2 - main.c | 2 +- mutt_idna.c | 8 +-- muttlib.c | 10 +-- mx.c | 8 +-- ncrypt/crypt.c | 82 +++++++++++----------- ncrypt/crypt_gpgme.c | 10 ++- ncrypt/pgp.c | 2 +- ncrypt/smime.c | 4 +- parameter.c | 6 +- parse.c | 158 +++++++++++++++++++++---------------------- pattern.c | 20 +++--- po/POTFILES.in | 1 - pop_auth.c | 2 +- pop_lib.c | 10 +-- postpone.c | 8 +-- recvattach.c | 16 ++--- remailer.c | 4 +- rfc1524.c | 22 +++--- rfc2047.c | 4 +- rfc3676.c | 2 +- rfc822.c | 2 +- send.c | 46 ++++++------- sendlib.c | 16 ++--- smtp.c | 12 ++-- url.c | 2 +- 48 files changed, 403 insertions(+), 553 deletions(-) delete mode 100644 lib/ascii.c delete mode 100644 lib/ascii.h diff --git a/account.c b/account.c index 6cd506777..74a260fd9 100644 --- a/account.c +++ b/account.c @@ -40,7 +40,7 @@ int mutt_account_match(const struct Account *a1, const struct Account *a2) if (a1->type != a2->type) return 0; - if (ascii_strcasecmp(a1->host, a2->host) != 0) + if (mutt_strcasecmp(a1->host, a2->host) != 0) return 0; if (a1->port != a2->port) return 0; diff --git a/addrbook.c b/addrbook.c index 31660df4d..6c0453ea0 100644 --- a/addrbook.c +++ b/addrbook.c @@ -131,7 +131,7 @@ static int alias_sort_address(const void *a, const void *b) else if (pb->personal) r = -1; else - r = ascii_strcasecmp(pa->mailbox, pb->mailbox); + r = mutt_strcasecmp(pa->mailbox, pb->mailbox); return (RSORT(r)); } diff --git a/alias.c b/alias.c index a7f14fb44..f3624a4a6 100644 --- a/alias.c +++ b/alias.c @@ -614,7 +614,7 @@ static bool string_is_address(const char *str, const char *u, const char *d) char buf[LONG_STRING]; snprintf(buf, sizeof(buf), "%s@%s", NONULL(u), NONULL(d)); - if (ascii_strcasecmp(str, buf) == 0) + if (mutt_strcasecmp(str, buf) == 0) return true; return false; @@ -640,7 +640,7 @@ bool mutt_addr_is_user(struct Address *addr) return false; } - if (ascii_strcasecmp(addr->mailbox, Username) == 0) + if (mutt_strcasecmp(addr->mailbox, Username) == 0) { mutt_debug(5, "mutt_addr_is_user: yes, %s = %s\n", addr->mailbox, Username); return true; @@ -665,7 +665,7 @@ bool mutt_addr_is_user(struct Address *addr) return true; } - if (From && (ascii_strcasecmp(From->mailbox, addr->mailbox) == 0)) + if (From && (mutt_strcasecmp(From->mailbox, addr->mailbox) == 0)) { mutt_debug(5, "mutt_addr_is_user: yes, %s = %s\n", addr->mailbox, From->mailbox); return true; diff --git a/attach.c b/attach.c index 657edf57f..9a5f72b36 100644 --- a/attach.c +++ b/attach.c @@ -314,8 +314,8 @@ void mutt_check_lookup_list(struct Body *b, char *type, int len) { i = mutt_strlen(t->data) - 1; if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' && - (ascii_strncasecmp(type, t->data, i) == 0)) || - (ascii_strcasecmp(type, t->data) == 0)) + (mutt_strncasecmp(type, t->data, i) == 0)) || + (mutt_strcasecmp(type, t->data) == 0)) { struct Body tmp = { 0 }; int n; @@ -1046,8 +1046,8 @@ int mutt_print_attachment(FILE *fp, struct Body *a) return 1; } - if ((ascii_strcasecmp("text/plain", type) == 0) || - (ascii_strcasecmp("application/postscript", type) == 0)) + if ((mutt_strcasecmp("text/plain", type) == 0) || + (mutt_strcasecmp("application/postscript", type) == 0)) { return (mutt_pipe_attachment(fp, a, NONULL(PrintCmd), NULL)); } diff --git a/charset.c b/charset.c index ffa123ea0..0c2372c9b 100644 --- a/charset.c +++ b/charset.c @@ -233,26 +233,26 @@ void mutt_canonical_charset(char *dest, size_t dlen, const char *name) if ((ext = strchr(in, '/'))) *ext++ = 0; - if ((ascii_strcasecmp(in, "utf-8") == 0) || (ascii_strcasecmp(in, "utf8") == 0)) + if ((mutt_strcasecmp(in, "utf-8") == 0) || (mutt_strcasecmp(in, "utf8") == 0)) { strfcpy(dest, "utf-8", dlen); goto out; } /* catch some common iso-8859-something misspellings */ - if ((ascii_strncasecmp(in, "8859", 4) == 0) && in[4] != '-') + if ((mutt_strncasecmp(in, "8859", 4) == 0) && in[4] != '-') snprintf(scratch, sizeof(scratch), "iso-8859-%s", in + 4); - else if (ascii_strncasecmp(in, "8859-", 5) == 0) + else if (mutt_strncasecmp(in, "8859-", 5) == 0) snprintf(scratch, sizeof(scratch), "iso-8859-%s", in + 5); - else if ((ascii_strncasecmp(in, "iso8859", 7) == 0) && in[7] != '-') + else if ((mutt_strncasecmp(in, "iso8859", 7) == 0) && in[7] != '-') snprintf(scratch, sizeof(scratch), "iso_8859-%s", in + 7); - else if (ascii_strncasecmp(in, "iso8859-", 8) == 0) + else if (mutt_strncasecmp(in, "iso8859-", 8) == 0) snprintf(scratch, sizeof(scratch), "iso_8859-%s", in + 8); else strfcpy(scratch, in, sizeof(scratch)); for (size_t i = 0; PreferredMIMENames[i].key; i++) - if ((ascii_strcasecmp(scratch, PreferredMIMENames[i].key) == 0) || + if ((mutt_strcasecmp(scratch, PreferredMIMENames[i].key) == 0) || (mutt_strcasecmp(scratch, PreferredMIMENames[i].key) == 0)) { strfcpy(dest, PreferredMIMENames[i].pref, dlen); @@ -290,7 +290,7 @@ int mutt_chscmp(const char *s, const char *chs) mutt_canonical_charset(buffer, sizeof(buffer), s); a = mutt_strlen(buffer); b = mutt_strlen(chs); - return (ascii_strncasecmp(a > b ? buffer : chs, a > b ? chs : buffer, MIN(a, b)) == 0); + return (mutt_strncasecmp(a > b ? buffer : chs, a > b ? chs : buffer, MIN(a, b)) == 0); } char *mutt_get_default_charset(void) @@ -638,8 +638,8 @@ bool mutt_check_charset(const char *s, bool strict) if (!strict) for (i = 0; PreferredMIMENames[i].key; i++) { - if ((ascii_strcasecmp(PreferredMIMENames[i].key, s) == 0) || - (ascii_strcasecmp(PreferredMIMENames[i].pref, s) == 0)) + if ((mutt_strcasecmp(PreferredMIMENames[i].key, s) == 0) || + (mutt_strcasecmp(PreferredMIMENames[i].pref, s) == 0)) return true; } diff --git a/color.c b/color.c index 1fd778f86..6ce34d01a 100644 --- a/color.c +++ b/color.c @@ -406,14 +406,14 @@ static int parse_color_name(const char *s, int *col, int *attr, int is_fg, struc char *eptr = NULL; int is_bright = 0; - if (ascii_strncasecmp(s, "bright", 6) == 0) + if (mutt_strncasecmp(s, "bright", 6) == 0) { is_bright = 1; s += 6; } /* allow aliases for xterm color resources */ - if (ascii_strncasecmp(s, "color", 5) == 0) + if (mutt_strncasecmp(s, "color", 5) == 0) { s += 5; *col = strtol(s, &eptr, 10); @@ -725,7 +725,7 @@ static int parse_object(struct Buffer *buf, struct Buffer *s, int *o, int *ql, *o = MT_COLOR_QUOTED; } - else if (!ascii_strcasecmp(buf->data, "compose")) + else if (!mutt_strcasecmp(buf->data, "compose")) { if (!MoreArgs(s)) { @@ -801,17 +801,17 @@ static int parse_attr_spec(struct Buffer *buf, struct Buffer *s, int *fg, mutt_extract_token(buf, s, 0); - if (ascii_strcasecmp("bold", buf->data) == 0) + if (mutt_strcasecmp("bold", buf->data) == 0) *attr |= A_BOLD; - else if (ascii_strcasecmp("underline", buf->data) == 0) + else if (mutt_strcasecmp("underline", buf->data) == 0) *attr |= A_UNDERLINE; - else if (ascii_strcasecmp("none", buf->data) == 0) + else if (mutt_strcasecmp("none", buf->data) == 0) *attr = A_NORMAL; - else if (ascii_strcasecmp("reverse", buf->data) == 0) + else if (mutt_strcasecmp("reverse", buf->data) == 0) *attr |= A_REVERSE; - else if (ascii_strcasecmp("standout", buf->data) == 0) + else if (mutt_strcasecmp("standout", buf->data) == 0) *attr |= A_STANDOUT; - else if (ascii_strcasecmp("normal", buf->data) == 0) + else if (mutt_strcasecmp("normal", buf->data) == 0) *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */ else { diff --git a/commands.c b/commands.c index 6ebb46db6..23698a091 100644 --- a/commands.c +++ b/commands.c @@ -979,9 +979,9 @@ void mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) mutt_parse_content_type(buf, b); snprintf(tmp, sizeof(tmp), "%s/%s", TYPE(b), NONULL(b->subtype)); - type_changed = ascii_strcasecmp(tmp, obuf); + type_changed = mutt_strcasecmp(tmp, obuf); charset_changed = - ascii_strcasecmp(charset, mutt_get_parameter("charset", b->parameter)); + mutt_strcasecmp(charset, mutt_get_parameter("charset", b->parameter)); /* if in send mode, check for conversion - current setting is default. */ diff --git a/copy.c b/copy.c index 372b3767d..7b1480960 100644 --- a/copy.c +++ b/copy.c @@ -108,25 +108,25 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, continue; from = true; } - else if (flags & (CH_NOQFROM) && (ascii_strncasecmp(">From ", buf, 6) == 0)) + else if (flags & (CH_NOQFROM) && (mutt_strncasecmp(">From ", buf, 6) == 0)) continue; else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n')) break; /* end of header */ if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) && - ((ascii_strncasecmp("Status:", buf, 7) == 0) || - (ascii_strncasecmp("X-Status:", buf, 9) == 0))) + ((mutt_strncasecmp("Status:", buf, 7) == 0) || + (mutt_strncasecmp("X-Status:", buf, 9) == 0))) continue; if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) && - ((ascii_strncasecmp("Content-Length:", buf, 15) == 0) || - (ascii_strncasecmp("Lines:", buf, 6) == 0))) + ((mutt_strncasecmp("Content-Length:", buf, 15) == 0) || + (mutt_strncasecmp("Lines:", buf, 6) == 0))) continue; - if ((flags & CH_UPDATE_REFS) && (ascii_strncasecmp("References:", buf, 11) == 0)) + if ((flags & CH_UPDATE_REFS) && (mutt_strncasecmp("References:", buf, 11) == 0)) continue; - if ((flags & CH_UPDATE_IRT) && (ascii_strncasecmp("In-Reply-To:", buf, 12) == 0)) + if ((flags & CH_UPDATE_IRT) && (mutt_strncasecmp("In-Reply-To:", buf, 12) == 0)) continue; - if (flags & CH_UPDATE_LABEL && (ascii_strncasecmp("X-Label:", buf, 8) == 0)) + if (flags & CH_UPDATE_LABEL && (mutt_strncasecmp("X-Label:", buf, 8) == 0)) continue; ignore = false; @@ -227,25 +227,25 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) && (flags & CH_WEED) && mutt_matches_ignore(buf)) continue; - if ((flags & CH_WEED_DELIVERED) && (ascii_strncasecmp("Delivered-To:", buf, 13) == 0)) + if ((flags & CH_WEED_DELIVERED) && (mutt_strncasecmp("Delivered-To:", buf, 13) == 0)) continue; if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) && - ((ascii_strncasecmp("Status:", buf, 7) == 0) || - (ascii_strncasecmp("X-Status:", buf, 9) == 0))) + ((mutt_strncasecmp("Status:", buf, 7) == 0) || + (mutt_strncasecmp("X-Status:", buf, 9) == 0))) continue; if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) && - ((ascii_strncasecmp("Content-Length:", buf, 15) == 0) || - (ascii_strncasecmp("Lines:", buf, 6) == 0))) + ((mutt_strncasecmp("Content-Length:", buf, 15) == 0) || + (mutt_strncasecmp("Lines:", buf, 6) == 0))) continue; if ((flags & CH_MIME) && - (((ascii_strncasecmp("content-", buf, 8) == 0) && - ((ascii_strncasecmp("transfer-encoding:", buf + 8, 18) == 0) || - (ascii_strncasecmp("type:", buf + 8, 5) == 0))) || - (ascii_strncasecmp("mime-version:", buf, 13) == 0))) + (((mutt_strncasecmp("content-", buf, 8) == 0) && + ((mutt_strncasecmp("transfer-encoding:", buf + 8, 18) == 0) || + (mutt_strncasecmp("type:", buf + 8, 5) == 0))) || + (mutt_strncasecmp("mime-version:", buf, 13) == 0))) continue; - if ((flags & CH_UPDATE_REFS) && (ascii_strncasecmp("References:", buf, 11) == 0)) + if ((flags & CH_UPDATE_REFS) && (mutt_strncasecmp("References:", buf, 11) == 0)) continue; - if ((flags & CH_UPDATE_IRT) && (ascii_strncasecmp("In-Reply-To:", buf, 12) == 0)) + if ((flags & CH_UPDATE_IRT) && (mutt_strncasecmp("In-Reply-To:", buf, 12) == 0)) continue; /* Find x -- the array entry where this header is to be saved */ @@ -253,7 +253,7 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, { for (t = HeaderOrderList, x = 0; (t); t = t->next, x++) { - if (ascii_strncasecmp(buf, t->data, mutt_strlen(t->data)) == 0) + if (mutt_strncasecmp(buf, t->data, mutt_strlen(t->data)) == 0) { mutt_debug(2, "Reorder: %s matches %s\n", t->data, buf); break; @@ -963,13 +963,13 @@ static int address_header_decode(char **h) { case 'r': { - if (ascii_strncasecmp(s, "return-path:", 12) == 0) + if (mutt_strncasecmp(s, "return-path:", 12) == 0) { l = 12; rp = true; break; } - else if (ascii_strncasecmp(s, "reply-to:", 9) == 0) + else if (mutt_strncasecmp(s, "reply-to:", 9) == 0) { l = 9; break; @@ -978,42 +978,42 @@ static int address_header_decode(char **h) } case 'f': { - if (ascii_strncasecmp(s, "from:", 5) != 0) + if (mutt_strncasecmp(s, "from:", 5) != 0) return 0; l = 5; break; } case 'c': { - if (ascii_strncasecmp(s, "cc:", 3) != 0) + if (mutt_strncasecmp(s, "cc:", 3) != 0) return 0; l = 3; break; } case 'b': { - if (ascii_strncasecmp(s, "bcc:", 4) != 0) + if (mutt_strncasecmp(s, "bcc:", 4) != 0) return 0; l = 4; break; } case 's': { - if (ascii_strncasecmp(s, "sender:", 7) != 0) + if (mutt_strncasecmp(s, "sender:", 7) != 0) return 0; l = 7; break; } case 't': { - if (ascii_strncasecmp(s, "to:", 3) != 0) + if (mutt_strncasecmp(s, "to:", 3) != 0) return 0; l = 3; break; } case 'm': { - if (ascii_strncasecmp(s, "mail-followup-to:", 17) != 0) + if (mutt_strncasecmp(s, "mail-followup-to:", 17) != 0) return 0; l = 17; break; diff --git a/from.c b/from.c index ef49ac94f..2e04e2a20 100644 --- a/from.c +++ b/from.c @@ -101,7 +101,7 @@ int is_from(const char *s, char *path, size_t pathlen, time_t *tp) return 0; /* pipermail archives have the return_path obscured such as "me at mutt.org" */ - if (ascii_strncasecmp(p, " at ", 4) == 0) + if (mutt_strncasecmp(p, " at ", 4) == 0) { p = strchr(p + 4, ' '); if (!p) diff --git a/handler.c b/handler.c index 83fbe998d..4c1bd8f01 100644 --- a/handler.c +++ b/handler.c @@ -972,12 +972,12 @@ static int is_mmnoask(const char *buf) { if (*(q + 1) == '*') { - if (ascii_strncasecmp(buf, p, q - p) == 0) + if (mutt_strncasecmp(buf, p, q - p) == 0) return 1; } else { - if (ascii_strcasecmp(buf, p) == 0) + if (mutt_strcasecmp(buf, p) == 0) return 1; } } @@ -1023,8 +1023,8 @@ static int is_autoview(struct Body *b) { int i = mutt_strlen(t->data) - 1; if ((i > 0 && t->data[i - 1] == '/' && t->data[i] == '*' && - (ascii_strncasecmp(type, t->data, i) == 0)) || - (ascii_strcasecmp(type, t->data) == 0)) + (mutt_strncasecmp(type, t->data, i) == 0)) || + (mutt_strcasecmp(type, t->data) == 0)) is_av = 1; } @@ -1064,7 +1064,7 @@ static int alternative_handler(struct Body *a, struct State *s) b->length = (long) st.st_size; b->parts = mutt_parse_multipart(s->fpin, mutt_get_parameter("boundary", a->parameter), (long) st.st_size, - (ascii_strcasecmp("digest", a->subtype) == 0)); + (mutt_strcasecmp("digest", a->subtype) == 0)); } else b = a; @@ -1098,10 +1098,10 @@ static int alternative_handler(struct Body *a, struct State *s) while (b) { const char *bt = TYPE(b); - if ((ascii_strncasecmp(bt, t->data, btlen) == 0) && (bt[btlen] == 0)) + if ((mutt_strncasecmp(bt, t->data, btlen) == 0) && (bt[btlen] == 0)) { /* the basetype matches */ - if (wild || (ascii_strcasecmp(t->data + btlen + 1, b->subtype) == 0)) + if (wild || (mutt_strcasecmp(t->data + btlen + 1, b->subtype) == 0)) { choice = b; } @@ -1137,17 +1137,17 @@ static int alternative_handler(struct Body *a, struct State *s) { if (b->type == TYPETEXT) { - if ((ascii_strcasecmp("plain", b->subtype) == 0) && type <= TXTPLAIN) + if ((mutt_strcasecmp("plain", b->subtype) == 0) && type <= TXTPLAIN) { choice = b; type = TXTPLAIN; } - else if ((ascii_strcasecmp("enriched", b->subtype) == 0) && type <= TXTENRICHED) + else if ((mutt_strcasecmp("enriched", b->subtype) == 0) && type <= TXTENRICHED) { choice = b; type = TXTENRICHED; } - else if ((ascii_strcasecmp("html", b->subtype) == 0) && type <= TXTHTML) + else if ((mutt_strcasecmp("html", b->subtype) == 0) && type <= TXTHTML) { choice = b; type = TXTHTML; @@ -1288,8 +1288,8 @@ int mutt_can_decode(struct Body *a) if (WithCrypto) { - if ((ascii_strcasecmp(a->subtype, "signed") == 0) || - (ascii_strcasecmp(a->subtype, "encrypted") == 0)) + if ((mutt_strcasecmp(a->subtype, "signed") == 0) || + (mutt_strcasecmp(a->subtype, "encrypted") == 0)) return 1; } @@ -1324,7 +1324,7 @@ static int multipart_handler(struct Body *a, struct State *s) b->length = (long) st.st_size; b->parts = mutt_parse_multipart(s->fpin, mutt_get_parameter("boundary", a->parameter), (long) st.st_size, - (ascii_strcasecmp("digest", a->subtype) == 0)); + (mutt_strcasecmp("digest", a->subtype) == 0)); } else b = a; @@ -1532,7 +1532,7 @@ static int external_body_handler(struct Body *b, struct State *s) else expire = -1; - if (ascii_strcasecmp(access_type, "x-mutt-deleted") == 0) + if (mutt_strcasecmp(access_type, "x-mutt-deleted") == 0) { if (s->flags & (MUTT_DISPLAY | MUTT_PRINTING)) { @@ -1858,7 +1858,7 @@ int mutt_body_handler(struct Body *b, struct State *s) } else if (b->type == TYPETEXT) { - if (ascii_strcasecmp("plain", b->subtype) == 0) + if (mutt_strcasecmp("plain", b->subtype) == 0) { /* avoid copying this part twice since removing the transfer-encoding is * the only operation needed. @@ -1866,12 +1866,12 @@ int mutt_body_handler(struct Body *b, struct State *s) if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)) handler = crypt_pgp_application_pgp_handler; else if (option(OPT_REFLOW_TEXT) && - (ascii_strcasecmp("flowed", mutt_get_parameter("format", b->parameter)) == 0)) + (mutt_strcasecmp("flowed", mutt_get_parameter("format", b->parameter)) == 0)) handler = rfc3676_handler; else handler = text_plain_handler; } - else if (ascii_strcasecmp("enriched", b->subtype) == 0) + else if (mutt_strcasecmp("enriched", b->subtype) == 0) handler = text_enriched_handler; else /* text body type without a handler */ plaintext = false; @@ -1880,9 +1880,9 @@ int mutt_body_handler(struct Body *b, struct State *s) { if (mutt_is_message_type(b->type, b->subtype)) handler = message_handler; - else if (ascii_strcasecmp("delivery-status", b->subtype) == 0) + else if (mutt_strcasecmp("delivery-status", b->subtype) == 0) plaintext = true; - else if (ascii_strcasecmp("external-body", b->subtype) == 0) + else if (mutt_strcasecmp("external-body", b->subtype) == 0) handler = external_body_handler; } else if (b->type == TYPEMULTIPART) @@ -1890,9 +1890,9 @@ int mutt_body_handler(struct Body *b, struct State *s) char *p = NULL; if ((mutt_strcmp("inline", ShowMultipartAlternative) != 0) && - (ascii_strcasecmp("alternative", b->subtype) == 0)) + (mutt_strcasecmp("alternative", b->subtype) == 0)) handler = alternative_handler; - else if (WithCrypto && (ascii_strcasecmp("signed", b->subtype) == 0)) + else if (WithCrypto && (mutt_strcasecmp("signed", b->subtype) == 0)) { p = mutt_get_parameter("protocol", b->parameter); @@ -1919,7 +1919,7 @@ int mutt_body_handler(struct Body *b, struct State *s) } else if (WithCrypto && b->type == TYPEAPPLICATION) { - if (option(OPT_DONT_HANDLE_PGP_KEYS) && (ascii_strcasecmp("pgp-keys", b->subtype) == 0)) + if (option(OPT_DONT_HANDLE_PGP_KEYS) && (mutt_strcasecmp("pgp-keys", b->subtype) == 0)) { /* pass raw part through for key extraction */ plaintext = true; diff --git a/headers.c b/headers.c index e4899233b..c427f1236 100644 --- a/headers.c +++ b/headers.c @@ -156,7 +156,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, { keep = true; - if (fcc && (ascii_strncasecmp("fcc:", cur->data, 4) == 0)) + if (fcc && (mutt_strncasecmp("fcc:", cur->data, 4) == 0)) { p = skip_email_wsp(cur->data + 4); if (*p) @@ -166,7 +166,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, } keep = false; } - else if (ascii_strncasecmp("attach:", cur->data, 7) == 0) + else if (mutt_strncasecmp("attach:", cur->data, 7) == 0) { struct Body *body2 = NULL; struct Body *parts = NULL; @@ -206,7 +206,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, keep = false; } else if ((WithCrypto & APPLICATION_PGP) && - (ascii_strncasecmp("pgp:", cur->data, 4) == 0)) + (mutt_strncasecmp("pgp:", cur->data, 4) == 0)) { msg->security = mutt_parse_crypt_hdr(cur->data + 4, 0, APPLICATION_PGP); if (msg->security) diff --git a/imap/auth.c b/imap/auth.c index 347e9ef38..515750326 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -82,7 +82,7 @@ int imap_authenticate(struct ImapData *idata) while (authenticator->authenticate) { - if (!authenticator->method || (ascii_strcasecmp(authenticator->method, method) == 0)) + if (!authenticator->method || (mutt_strcasecmp(authenticator->method, method) == 0)) if ((r = authenticator->authenticate(idata, method)) != IMAP_AUTH_UNAVAIL) { FREE(&methods); diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index d33239b41..16856ffe8 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -79,7 +79,7 @@ enum ImapAuthRes imap_auth_sasl(struct ImapData *idata, const char *method) (mutt_strncmp(idata->conn->account.user, "anonymous", 9) == 0))) rc = sasl_client_start(saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, &mech); } - else if ((ascii_strcasecmp("login", method) == 0) && + else if ((mutt_strcasecmp("login", method) == 0) && !strstr(NONULL(idata->capstr), "AUTH=LOGIN")) /* do not use SASL login for regular IMAP login (#3556) */ return IMAP_AUTH_UNAVAIL; diff --git a/imap/command.c b/imap/command.c index bea146921..894f1b704 100644 --- a/imap/command.c +++ b/imap/command.c @@ -198,9 +198,9 @@ static int cmd_status(const char *s) { s = imap_next_word((char *) s); - if (ascii_strncasecmp("OK", s, 2) == 0) + if (mutt_strncasecmp("OK", s, 2) == 0) return IMAP_CMD_OK; - if (ascii_strncasecmp("NO", s, 2) == 0) + if (mutt_strncasecmp("NO", s, 2) == 0) return IMAP_CMD_NO; return IMAP_CMD_BAD; @@ -288,7 +288,7 @@ static void cmd_parse_fetch(struct ImapData *idata, char *s) } s++; - if (ascii_strncasecmp("FLAGS", s, 5) != 0) + if (mutt_strncasecmp("FLAGS", s, 5) != 0) { mutt_debug(2, "Only handle FLAGS updates\n"); return; @@ -375,12 +375,12 @@ static void cmd_parse_list(struct ImapData *idata, char *s) s++; while (*s) { - if (ascii_strncasecmp(s, "\\NoSelect", 9) == 0) + if (mutt_strncasecmp(s, "\\NoSelect", 9) == 0) list->noselect = true; - else if (ascii_strncasecmp(s, "\\NoInferiors", 12) == 0) + else if (mutt_strncasecmp(s, "\\NoInferiors", 12) == 0) list->noinferiors = true; /* See draft-gahrns-imap-child-mailbox-?? */ - else if (ascii_strncasecmp(s, "\\HasNoChildren", 14) == 0) + else if (mutt_strncasecmp(s, "\\HasNoChildren", 14) == 0) list->noinferiors = true; s = imap_next_word(s); @@ -389,7 +389,7 @@ static void cmd_parse_list(struct ImapData *idata, char *s) } /* Delimiter */ - if (ascii_strncasecmp(s, "NIL", 3) != 0) + if (mutt_strncasecmp(s, "NIL", 3) != 0) { delimbuf[0] = '\0'; safe_strcat(delimbuf, 5, s); @@ -723,8 +723,8 @@ static void cmd_parse_enabled(struct ImapData *idata, const char *s) while ((s = imap_next_word((char *) s)) && *s != '\0') { - if ((ascii_strncasecmp(s, "UTF8=ACCEPT", 11) == 0) || - (ascii_strncasecmp(s, "UTF8=ONLY", 9) == 0)) + if ((mutt_strncasecmp(s, "UTF8=ACCEPT", 11) == 0) || + (mutt_strncasecmp(s, "UTF8=ONLY", 9) == 0)) idata->unicode = 1; } } @@ -749,7 +749,7 @@ static int cmd_handle_untagged(struct ImapData *idata) /* EXISTS and EXPUNGE are always related to the SELECTED mailbox for the * connection, so update that one. */ - if (ascii_strncasecmp("EXISTS", s, 6) == 0) + if (mutt_strncasecmp("EXISTS", s, 6) == 0) { mutt_debug(2, "Handling EXISTS\n"); @@ -780,30 +780,30 @@ static int cmd_handle_untagged(struct ImapData *idata) } } /* pn vs. s: need initial seqno */ - else if (ascii_strncasecmp("EXPUNGE", s, 7) == 0) + else if (mutt_strncasecmp("EXPUNGE", s, 7) == 0) cmd_parse_expunge(idata, pn); - else if (ascii_strncasecmp("FETCH", s, 5) == 0) + else if (mutt_strncasecmp("FETCH", s, 5) == 0) cmd_parse_fetch(idata, pn); } - else if (ascii_strncasecmp("CAPABILITY", s, 10) == 0) + else if (mutt_strncasecmp("CAPABILITY", s, 10) == 0) cmd_parse_capability(idata, s); - else if (ascii_strncasecmp("OK [CAPABILITY", s, 14) == 0) + else if (mutt_strncasecmp("OK [CAPABILITY", s, 14) == 0) cmd_parse_capability(idata, pn); - else if (ascii_strncasecmp("OK [CAPABILITY", pn, 14) == 0) + else if (mutt_strncasecmp("OK [CAPABILITY", pn, 14) == 0) cmd_parse_capability(idata, imap_next_word(pn)); - else if (ascii_strncasecmp("LIST", s, 4) == 0) + else if (mutt_strncasecmp("LIST", s, 4) == 0) cmd_parse_list(idata, s); - else if (ascii_strncasecmp("LSUB", s, 4) == 0) + else if (mutt_strncasecmp("LSUB", s, 4) == 0) cmd_parse_lsub(idata, s); - else if (ascii_strncasecmp("MYRIGHTS", s, 8) == 0) + else if (mutt_strncasecmp("MYRIGHTS", s, 8) == 0) cmd_parse_myrights(idata, s); - else if (ascii_strncasecmp("SEARCH", s, 6) == 0) + else if (mutt_strncasecmp("SEARCH", s, 6) == 0) cmd_parse_search(idata, s); - else if (ascii_strncasecmp("STATUS", s, 6) == 0) + else if (mutt_strncasecmp("STATUS", s, 6) == 0) cmd_parse_status(idata, s); - else if (ascii_strncasecmp("ENABLED", s, 7) == 0) + else if (mutt_strncasecmp("ENABLED", s, 7) == 0) cmd_parse_enabled(idata, s); - else if (ascii_strncasecmp("BYE", s, 3) == 0) + else if (mutt_strncasecmp("BYE", s, 3) == 0) { mutt_debug(2, "Handling BYE\n"); @@ -820,7 +820,7 @@ static int cmd_handle_untagged(struct ImapData *idata) return -1; } - else if (option(OPT_IMAP_SERVER_NOISE) && (ascii_strncasecmp("NO", s, 2) == 0)) + else if (option(OPT_IMAP_SERVER_NOISE) && (mutt_strncasecmp("NO", s, 2) == 0)) { mutt_debug(2, "Handling untagged NO\n"); @@ -984,8 +984,8 @@ const char *imap_cmd_trailer(struct ImapData *idata) } s = imap_next_word((char *) s); - if (!s || ((ascii_strncasecmp(s, "OK", 2) != 0) && (ascii_strncasecmp(s, "NO", 2) != 0) && - (ascii_strncasecmp(s, "BAD", 3) != 0))) + if (!s || ((mutt_strncasecmp(s, "OK", 2) != 0) && (mutt_strncasecmp(s, "NO", 2) != 0) && + (mutt_strncasecmp(s, "BAD", 3) != 0))) { mutt_debug(2, "imap_cmd_trailer: not a command completion: %s\n", idata->buf); return notrailer; diff --git a/imap/imap.c b/imap/imap.c index b5a1a96f6..4d2f8d096 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -460,9 +460,9 @@ int imap_open_connection(struct ImapData *idata) return -1; } - if (ascii_strncasecmp("* OK", idata->buf, 4) == 0) + if (mutt_strncasecmp("* OK", idata->buf, 4) == 0) { - if ((ascii_strncasecmp("* OK [CAPABILITY", idata->buf, 16) != 0) && + if ((mutt_strncasecmp("* OK [CAPABILITY", idata->buf, 16) != 0) && imap_check_capabilities(idata)) goto bail; #ifdef USE_SSL @@ -507,7 +507,7 @@ int imap_open_connection(struct ImapData *idata) } #endif } - else if (ascii_strncasecmp("* PREAUTH", idata->buf, 9) == 0) + else if (mutt_strncasecmp("* PREAUTH", idata->buf, 9) == 0) { idata->state = IMAP_AUTHENTICATED; if (imap_check_capabilities(idata) != 0) @@ -554,7 +554,7 @@ static char *imap_get_flags(struct List **hflags, char *s) char ctmp; /* sanity-check string */ - if (ascii_strncasecmp("FLAGS", s, 5) != 0) + if (mutt_strncasecmp("FLAGS", s, 5) != 0) { mutt_debug(1, "imap_get_flags: not a FLAGS response: %s\n", s); return NULL; @@ -693,7 +693,7 @@ static int imap_open_mailbox(struct Context *ctx) /* Obtain list of available flags here, may be overridden by a * PERMANENTFLAGS tag in the OK response */ - if (ascii_strncasecmp("FLAGS", pc, 5) == 0) + if (mutt_strncasecmp("FLAGS", pc, 5) == 0) { /* don't override PERMANENTFLAGS */ if (!idata->flags) @@ -704,7 +704,7 @@ static int imap_open_mailbox(struct Context *ctx) } } /* PERMANENTFLAGS are massaged to look like FLAGS, then override FLAGS */ - else if (ascii_strncasecmp("OK [PERMANENTFLAGS", pc, 18) == 0) + else if (mutt_strncasecmp("OK [PERMANENTFLAGS", pc, 18) == 0) { mutt_debug(3, "Getting mailbox PERMANENTFLAGS\n"); /* safe to call on NULL */ @@ -715,7 +715,7 @@ static int imap_open_mailbox(struct Context *ctx) goto fail; } /* save UIDVALIDITY for the header cache */ - else if (ascii_strncasecmp("OK [UIDVALIDITY", pc, 14) == 0) + else if (mutt_strncasecmp("OK [UIDVALIDITY", pc, 14) == 0) { mutt_debug(3, "Getting mailbox UIDVALIDITY\n"); pc += 3; @@ -723,7 +723,7 @@ static int imap_open_mailbox(struct Context *ctx) idata->uid_validity = strtol(pc, NULL, 10); status->uidvalidity = idata->uid_validity; } - else if (ascii_strncasecmp("OK [UIDNEXT", pc, 11) == 0) + else if (mutt_strncasecmp("OK [UIDNEXT", pc, 11) == 0) { mutt_debug(3, "Getting mailbox UIDNEXT\n"); pc += 3; @@ -734,7 +734,7 @@ static int imap_open_mailbox(struct Context *ctx) else { pc = imap_next_word(pc); - if (ascii_strncasecmp("EXISTS", pc, 6) == 0) + if (mutt_strncasecmp("EXISTS", pc, 6) == 0) { count = idata->new_mail_count; idata->new_mail_count = 0; @@ -756,7 +756,7 @@ static int imap_open_mailbox(struct Context *ctx) goto fail; /* check for READ-ONLY notification */ - if ((ascii_strncasecmp(imap_get_qualifier(idata->buf), "[READ-ONLY]", 11) == 0) && + if ((mutt_strncasecmp(imap_get_qualifier(idata->buf), "[READ-ONLY]", 11) == 0) && !mutt_bit_isset(idata->capabilities, ACL)) { mutt_debug(2, "Mailbox is read-only.\n"); @@ -920,7 +920,7 @@ bool imap_has_flag(struct List *flag_list, const char *flag) flag_list = flag_list->next; while (flag_list) { - if (ascii_strncasecmp(flag_list->data, flag, strlen(flag_list->data)) == 0) + if (mutt_strncasecmp(flag_list->data, flag, strlen(flag_list->data)) == 0) return true; if (mutt_strncmp(flag_list->data, "\\*", strlen(flag_list->data)) == 0) @@ -2284,7 +2284,7 @@ int imap_fast_trash(struct Context *ctx, char *dest) break; } /* bail out if command failed for reasons other than nonexistent target */ - if (ascii_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0) + if (mutt_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0) break; mutt_debug(3, "imap_fast_trash: server suggests TRYCREATE\n"); snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox); diff --git a/imap/message.c b/imap/message.c index b87df6296..f888c05b4 100644 --- a/imap/message.c +++ b/imap/message.c @@ -141,7 +141,7 @@ static char *msg_parse_flags(struct ImapHeader *h, char *s) struct ImapHeaderData *hd = h->data; /* sanity-check string */ - if (ascii_strncasecmp("FLAGS", s, 5) != 0) + if (mutt_strncasecmp("FLAGS", s, 5) != 0) { mutt_debug(1, "msg_parse_flags: not a FLAGS response: %s\n", s); return NULL; @@ -161,29 +161,29 @@ static char *msg_parse_flags(struct ImapHeader *h, char *s) /* start parsing */ while (*s && *s != ')') { - if (ascii_strncasecmp("\\deleted", s, 8) == 0) + if (mutt_strncasecmp("\\deleted", s, 8) == 0) { s += 8; hd->deleted = true; } - else if (ascii_strncasecmp("\\flagged", s, 8) == 0) + else if (mutt_strncasecmp("\\flagged", s, 8) == 0) { s += 8; hd->flagged = true; } - else if (ascii_strncasecmp("\\answered", s, 9) == 0) + else if (mutt_strncasecmp("\\answered", s, 9) == 0) { s += 9; hd->replied = true; } - else if (ascii_strncasecmp("\\seen", s, 5) == 0) + else if (mutt_strncasecmp("\\seen", s, 5) == 0) { s += 5; hd->read = true; } - else if (ascii_strncasecmp("\\recent", s, 7) == 0) + else if (mutt_strncasecmp("\\recent", s, 7) == 0) s += 7; - else if (ascii_strncasecmp("old", s, 3) == 0) + else if (mutt_strncasecmp("old", s, 3) == 0) { s += 3; hd->old = option(OPT_MARK_OLD) ? true : false; @@ -239,12 +239,12 @@ static int msg_parse_fetch(struct ImapHeader *h, char *s) { SKIPWS(s); - if (ascii_strncasecmp("FLAGS", s, 5) == 0) + if (mutt_strncasecmp("FLAGS", s, 5) == 0) { if ((s = msg_parse_flags(h, s)) == NULL) return -1; } - else if (ascii_strncasecmp("UID", s, 3) == 0) + else if (mutt_strncasecmp("UID", s, 3) == 0) { s += 3; SKIPWS(s); @@ -252,7 +252,7 @@ static int msg_parse_fetch(struct ImapHeader *h, char *s) s = imap_next_word(s); } - else if (ascii_strncasecmp("INTERNALDATE", s, 12) == 0) + else if (mutt_strncasecmp("INTERNALDATE", s, 12) == 0) { s += 12; SKIPWS(s); @@ -271,7 +271,7 @@ static int msg_parse_fetch(struct ImapHeader *h, char *s) *ptmp = 0; h->received = imap_parse_date(tmp); } - else if (ascii_strncasecmp("RFC822.SIZE", s, 11) == 0) + else if (mutt_strncasecmp("RFC822.SIZE", s, 11) == 0) { s += 11; SKIPWS(s); @@ -281,8 +281,8 @@ static int msg_parse_fetch(struct ImapHeader *h, char *s) *ptmp = 0; h->content_length = atoi(tmp); } - else if ((ascii_strncasecmp("BODY", s, 4) == 0) || - (ascii_strncasecmp("RFC822.HEADER", s, 13) == 0)) + else if ((mutt_strncasecmp("BODY", s, 4) == 0) || + (mutt_strncasecmp("RFC822.HEADER", s, 13) == 0)) { /* handle above, in msg_fetch_header */ return -2; @@ -326,7 +326,7 @@ static int msg_fetch_header(struct Context *ctx, struct ImapHeader *h, char *buf /* find FETCH tag */ buf = imap_next_word(buf); - if (ascii_strncasecmp("FETCH", buf, 5) != 0) + if (mutt_strncasecmp("FETCH", buf, 5) != 0) return rc; rc = -2; /* we've got a FETCH response, for better or worse */ @@ -921,14 +921,14 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno) pc = imap_next_word(pc); pc = imap_next_word(pc); - if (ascii_strncasecmp("FETCH", pc, 5) == 0) + if (mutt_strncasecmp("FETCH", pc, 5) == 0) { while (*pc) { pc = imap_next_word(pc); if (pc[0] == '(') pc++; - if (ascii_strncasecmp("UID", pc, 3) == 0) + if (mutt_strncasecmp("UID", pc, 3) == 0) { pc = imap_next_word(pc); uid = atoi(pc); @@ -936,8 +936,8 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno) mutt_error(_( "The message index is incorrect. Try reopening the mailbox.")); } - else if ((ascii_strncasecmp("RFC822", pc, 6) == 0) || - (ascii_strncasecmp("BODY[]", pc, 6) == 0)) + else if ((mutt_strncasecmp("RFC822", pc, 6) == 0) || + (mutt_strncasecmp("BODY[]", pc, 6) == 0)) { pc = imap_next_word(pc); if (imap_get_literal_count(pc, &bytes) < 0) @@ -964,7 +964,7 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno) * change (eg from \Unseen to \Seen). * Uncommitted changes in mutt take precedence. If we decide to * incrementally update flags later, this won't stop us syncing */ - else if ((ascii_strncasecmp("FLAGS", pc, 5) == 0) && !h->changed) + else if ((mutt_strncasecmp("FLAGS", pc, 5) == 0) && !h->changed) { if ((pc = imap_set_flags(idata, h, pc)) == NULL) goto bail; @@ -1312,7 +1312,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de break; } /* bail out if command failed for reasons other than nonexistent target */ - if (ascii_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0) + if (mutt_strncasecmp(imap_get_qualifier(idata->buf), "[TRYCREATE]", 11) != 0) break; mutt_debug(3, "imap_copy_messages: server suggests TRYCREATE\n"); snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox); diff --git a/imap/util.c b/imap/util.c index 45d864ee1..e7183226e 100644 --- a/imap/util.c +++ b/imap/util.c @@ -404,8 +404,8 @@ int imap_mxcmp(const char *mx1, const char *mx2) mx1 = "INBOX"; if (!mx2 || !*mx2) mx2 = "INBOX"; - if ((ascii_strcasecmp(mx1, "INBOX") == 0) && - (ascii_strcasecmp(mx2, "INBOX") == 0)) + if ((mutt_strcasecmp(mx1, "INBOX") == 0) && + (mutt_strcasecmp(mx2, "INBOX") == 0)) return 0; b1 = safe_malloc(strlen(mx1) + 1); @@ -880,7 +880,7 @@ int imap_wordcasecmp(const char *a, const char *b) } tmp[i + 1] = 0; - return ascii_strcasecmp(a, tmp); + return mutt_strcasecmp(a, tmp); } /* diff --git a/init.c b/init.c index cad0b6f5c..cce4eb582 100644 --- a/init.c +++ b/init.c @@ -759,7 +759,7 @@ static void add_to_list(struct List **list, const char *str) /* check to make sure the item is not already on this list */ for (last = *list; last; last = last->next) { - if (ascii_strcasecmp(str, last->data) == 0) + if (mutt_strcasecmp(str, last->data) == 0) { /* already on the list, so just ignore it */ last = NULL; @@ -805,7 +805,7 @@ int mutt_add_to_rx_list(struct RxList **list, const char *s, int flags, struct B /* check to make sure the item is not already on this list */ for (last = *list; last; last = last->next) { - if (ascii_strcasecmp(rx->pattern, last->rx->pattern) == 0) + if (mutt_strcasecmp(rx->pattern, last->rx->pattern) == 0) { /* already on the list, so just ignore it */ last = NULL; @@ -895,7 +895,7 @@ static int add_to_replace_list(struct ReplaceList **list, const char *pat, /* check to make sure the item is not already on this list */ for (last = *list; last; last = last->next) { - if (ascii_strcasecmp(rx->pattern, last->rx->pattern) == 0) + if (mutt_strcasecmp(rx->pattern, last->rx->pattern) == 0) { /* Already on the list. Formerly we just skipped this case, but * now we're supporting removals, which means we're supporting @@ -971,7 +971,7 @@ static void remove_from_list(struct List **l, const char *str) last = NULL; while (p) { - if (ascii_strcasecmp(str, p->data) == 0) + if (mutt_strcasecmp(str, p->data) == 0) { FREE(&p->data); if (last) @@ -1591,9 +1591,9 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, a = safe_malloc(sizeof(struct AttachMatch)); /* some cheap hacks that I expect to remove */ - if (ascii_strcasecmp(buf->data, "any") == 0) + if (mutt_strcasecmp(buf->data, "any") == 0) a->major = safe_strdup("*/.*"); - else if (ascii_strcasecmp(buf->data, "none") == 0) + else if (mutt_strcasecmp(buf->data, "none") == 0) a->major = safe_strdup("cheap_hack/this_should_never_match"); else a->major = safe_strdup(buf->data); @@ -1663,9 +1663,9 @@ static int parse_unattach_list(struct Buffer *buf, struct Buffer *s, mutt_extract_token(buf, s, 0); FREE(&tmp); - if (ascii_strcasecmp(buf->data, "any") == 0) + if (mutt_strcasecmp(buf->data, "any") == 0) tmp = safe_strdup("*/.*"); - else if (ascii_strcasecmp(buf->data, "none") == 0) + else if (mutt_strcasecmp(buf->data, "none") == 0) tmp = safe_strdup("cheap_hack/this_should_never_match"); else tmp = safe_strdup(buf->data); @@ -1767,14 +1767,14 @@ static int parse_attachments(struct Buffer *buf, struct Buffer *s, op = '+'; category--; } - if (ascii_strncasecmp(category, "attachment", strlen(category)) == 0) + if (mutt_strncasecmp(category, "attachment", strlen(category)) == 0) { if (op == '+') listp = &AttachAllow; else listp = &AttachExclude; } - else if (ascii_strncasecmp(category, "inline", strlen(category)) == 0) + else if (mutt_strncasecmp(category, "inline", strlen(category)) == 0) { if (op == '+') listp = &InlineAllow; @@ -1810,14 +1810,14 @@ static int parse_unattachments(struct Buffer *buf, struct Buffer *s, op = '+'; p--; } - if (ascii_strncasecmp(p, "attachment", strlen(p)) == 0) + if (mutt_strncasecmp(p, "attachment", strlen(p)) == 0) { if (op == '+') listp = &AttachAllow; else listp = &AttachExclude; } - else if (ascii_strncasecmp(p, "inline", strlen(p)) == 0) + else if (mutt_strncasecmp(p, "inline", strlen(p)) == 0) { if (op == '+') listp = &InlineAllow; @@ -2056,7 +2056,7 @@ static int parse_unmy_hdr(struct Buffer *buf, struct Buffer *s, while (tmp) { - if ((ascii_strncasecmp(buf->data, tmp->data, l) == 0) && tmp->data[l] == ':') + if ((mutt_strncasecmp(buf->data, tmp->data, l) == 0) && tmp->data[l] == ':') { ptr = tmp; if (last) @@ -2098,7 +2098,7 @@ static int parse_my_hdr(struct Buffer *buf, struct Buffer *s, for (tmp = UserHeader;; tmp = tmp->next) { /* see if there is already a field by this name */ - if (ascii_strncasecmp(buf->data, tmp->data, keylen) == 0) + if (mutt_strncasecmp(buf->data, tmp->data, keylen) == 0) { /* replace the old value */ FREE(&tmp->data); @@ -2688,9 +2688,9 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, s->dptr++; mutt_extract_token(tmp, s, 0); - if (ascii_strcasecmp("yes", tmp->data) == 0) + if (mutt_strcasecmp("yes", tmp->data) == 0) unset = inv = 0; - else if (ascii_strcasecmp("no", tmp->data) == 0) + else if (mutt_strcasecmp("no", tmp->data) == 0) unset = 1; else { @@ -3039,13 +3039,13 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, { s->dptr++; mutt_extract_token(tmp, s, 0); - if (ascii_strcasecmp("yes", tmp->data) == 0) + if (mutt_strcasecmp("yes", tmp->data) == 0) set_quadoption(MuttVars[idx].data, MUTT_YES); - else if (ascii_strcasecmp("no", tmp->data) == 0) + else if (mutt_strcasecmp("no", tmp->data) == 0) set_quadoption(MuttVars[idx].data, MUTT_NO); - else if (ascii_strcasecmp("ask-yes", tmp->data) == 0) + else if (mutt_strcasecmp("ask-yes", tmp->data) == 0) set_quadoption(MuttVars[idx].data, MUTT_ASKYES); - else if (ascii_strcasecmp("ask-no", tmp->data) == 0) + else if (mutt_strcasecmp("ask-no", tmp->data) == 0) set_quadoption(MuttVars[idx].data, MUTT_ASKNO); else { @@ -4095,7 +4095,7 @@ const char *mutt_getnamebyvalue(int val, const struct Mapping *map) int mutt_getvaluebyname(const char *name, const struct Mapping *map) { for (int i = 0; map[i].name; i++) - if (ascii_strcasecmp(map[i].name, name) == 0) + if (mutt_strcasecmp(map[i].name, name) == 0) return map[i].value; return -1; } @@ -4555,7 +4555,7 @@ int mutt_get_hook_type(const char *name) const struct Command *c = NULL; for (c = Commands; c->name; c++) - if (c->func == mutt_parse_hook && (ascii_strcasecmp(c->name, name) == 0)) + if (c->func == mutt_parse_hook && (mutt_strcasecmp(c->name, name) == 0)) return c->data; return 0; } diff --git a/keymap.c b/keymap.c index 87fe8f214..e7bd65cb1 100644 --- a/keymap.c +++ b/keymap.c @@ -354,7 +354,7 @@ static int get_op(const struct Binding *bindings, const char *start, size_t len) { for (int i = 0; bindings[i].name; i++) { - if ((ascii_strncasecmp(start, bindings[i].name, len) == 0) && + if ((mutt_strncasecmp(start, bindings[i].name, len) == 0) && mutt_strlen(bindings[i].name) == len) return bindings[i].op; } @@ -406,7 +406,7 @@ static void generic_tokenize_push_string(char *s, void (*generic_push)(int, int) l = p - pp + 1; for (i = 0; KeyNames[i].name; i++) { - if (ascii_strncasecmp(pp, KeyNames[i].name, l) == 0) + if (mutt_strncasecmp(pp, KeyNames[i].name, l) == 0) break; } if (KeyNames[i].name) @@ -1101,7 +1101,7 @@ int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, strfcpy(err->data, _("bind: too many arguments"), err->dsize); r = -1; } - else if (ascii_strcasecmp("noop", buf->data) == 0) + else if (mutt_strcasecmp("noop", buf->data) == 0) { for (i = 0; i < nummenus; ++i) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 6cb05204b..3a7223fa2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,11 +3,11 @@ include $(top_srcdir)/flymake.am AUTOMAKE_OPTIONS = 1.6 foreign -EXTRA_DIST = lib.h ascii.h base64.h buffer.h date.h debug.h exit.h file.h hash.h md5.h memory.h message.h sha1.h string2.h +EXTRA_DIST = lib.h base64.h buffer.h date.h debug.h exit.h file.h hash.h md5.h memory.h message.h sha1.h string2.h AM_CPPFLAGS = -I$(top_srcdir) noinst_LIBRARIES = libmutt.a -libmutt_a_SOURCES = ascii.c base64.c buffer.c date.c debug.c exit.c file.c hash.c md5.c memory.c message.c sha1.c string.c +libmutt_a_SOURCES = base64.c buffer.c date.c debug.c exit.c file.c hash.c md5.c memory.c message.c sha1.c string.c diff --git a/lib/ascii.c b/lib/ascii.c deleted file mode 100644 index 2fdcb7509..000000000 --- a/lib/ascii.c +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file - * ASCII string comparison routines - * - * @authors - * Copyright (C) 2001 Thomas Roessler - * - * @copyright - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -/** - * @page ascii ASCII string comparison routines - * - * Simple ASCII string comparisons. - * - * | Function | Description - * | :------------------ | :--------------------------------- - * | ascii_strcasecmp() | Compare strings, ignoring the case - * | ascii_strlower() | Lowercase a string - * | ascii_strncasecmp() | Compare strings, ignoring the case - */ - -/* - * Versions of the string comparison functions which are - * locale-insensitive. - */ - -#include "config.h" -#include -#include -#include "ascii.h" - -/** - * ascii_strcasecmp - Compare strings, ignoring the case - * @param a First string to compare - * @param b Second string to compare - * @retval -1 a precedes b - * @retval 0 a and b are identical - * @retval 1 b precedes a - */ -int ascii_strcasecmp(const char *a, const char *b) -{ - if (a == b) - return 0; - if (a == NULL && b) - return -1; - if (b == NULL && a) - return 1; - - for (;; a++, b++) - { - int i = tolower(*a) - tolower(*b); - if (i) - return i; - /* test for NUL here rather than in the for loop in order to detect unequal - * length strings */ - if (!*a) - break; - } - - return 0; -} - -/** - * ascii_strncasecmp - Compare strings, ignoring the case - * @param a First string to compare - * @param b Second string to compare - * @param n Maximum number of characters to compare - * @retval -1 a precedes b - * @retval 0 a and b are identical - * @retval 1 b precedes a - */ -int ascii_strncasecmp(const char *a, const char *b, int n) -{ - if (a == b) - return 0; - if (a == NULL && b) - return -1; - if (b == NULL && a) - return 1; - - for (int j = 0; (*a || *b) && j < n; a++, b++, j++) - { - int i = tolower(*a) - tolower(*b); - if (i) - return i; - } - - return 0; -} - -/** - * ascii_strlower - Lowercase a string - * @param s String to transform - * @retval ptr Transformed string - * - * The string is transformed in place. - */ -char *ascii_strlower(char *s) -{ - char *p = s; - - for (; *p; ++p) - *p = tolower(*p); - - return s; -} diff --git a/lib/ascii.h b/lib/ascii.h deleted file mode 100644 index a9ffcf006..000000000 --- a/lib/ascii.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file - * ASCII string comparison routines - * - * @authors - * Copyright (C) 2001-2002 Thomas Roessler - * - * @copyright - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -/* - * Versions of the string comparison functions which are locale-insensitive. - */ - -#ifndef _LIB_ASCII_H -#define _LIB_ASCII_H - -int ascii_strcasecmp(const char *a, const char *b); -int ascii_strncasecmp(const char *a, const char *b, int n); -char *ascii_strlower(char *s); - -#endif /* _LIB_ASCII_H */ diff --git a/lib/lib.h b/lib/lib.h index 7a082ec31..62186c6a3 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -28,7 +28,6 @@ * The library is self-contained -- some files may depend on others in the * library, but none depends on source from outside. * - * -# @subpage ascii * -# @subpage base64 * -# @subpage buffer * -# @subpage date @@ -46,7 +45,6 @@ #ifndef _LIB_LIB_H #define _LIB_LIB_H -#include "ascii.h" #include "base64.h" #include "buffer.h" #include "date.h" diff --git a/main.c b/main.c index 83f254706..936dafb3e 100644 --- a/main.c +++ b/main.c @@ -710,7 +710,7 @@ int main(int argc, char **argv, char **env) /* Scan for mutt header to set OPT_RESUME_DRAFT_FILES */ for (last_uhp = &msg->env->userhdrs, uh = *last_uhp; uh; uh = *last_uhp) { - if (ascii_strncasecmp("X-Mutt-Resume-Draft:", uh->data, 20) == 0) + if (mutt_strncasecmp("X-Mutt-Resume-Draft:", uh->data, 20) == 0) { if (option(OPT_RESUME_EDITED_DRAFT_FILES)) set_option(OPT_RESUME_DRAFT_FILES); diff --git a/mutt_idna.c b/mutt_idna.c index 2cc371af7..0a80fedd4 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -38,12 +38,12 @@ static bool check_idn(char *domain) if (!domain) return false; - if (ascii_strncasecmp(domain, "xn--", 4) == 0) + if (mutt_strncasecmp(domain, "xn--", 4) == 0) return true; while ((domain = strchr(domain, '.')) != NULL) { - if (ascii_strncasecmp(++domain, "xn--", 4) == 0) + if (mutt_strncasecmp(++domain, "xn--", 4) == 0) return true; } @@ -139,7 +139,7 @@ static char *intl_to_local(char *orig_user, char *orig_domain, int flags) goto cleanup; } - if (ascii_strcasecmp(orig_user, reversed_user) != 0) + if (mutt_strcasecmp(orig_user, reversed_user) != 0) { mutt_debug( 1, "intl_to_local: Not reversible. orig = '%s', reversed = '%s'.\n", @@ -175,7 +175,7 @@ static char *intl_to_local(char *orig_user, char *orig_domain, int flags) } #endif /* HAVE_LIBIDN */ - if (ascii_strcasecmp(orig_domain, reversed_domain) != 0) + if (mutt_strcasecmp(orig_domain, reversed_domain) != 0) { mutt_debug( 1, "intl_to_local: Not reversible. orig = '%s', reversed = '%s'.\n", diff --git a/muttlib.c b/muttlib.c index 43b8fd8ac..3e822abbd 100644 --- a/muttlib.c +++ b/muttlib.c @@ -330,7 +330,7 @@ int mutt_remove_from_rx_list(struct RxList **l, const char *str) last = NULL; while (p) { - if (ascii_strcasecmp(str, p->rx->pattern) == 0) + if (mutt_strcasecmp(str, p->rx->pattern) == 0) { mutt_free_regexp(&p->rx); if (last) @@ -413,7 +413,7 @@ bool mutt_matches_list(const char *s, struct List *t) { for (; t; t = t->next) { - if ((ascii_strncasecmp(s, t->data, mutt_strlen(t->data)) == 0) || *t->data == '*') + if ((mutt_strncasecmp(s, t->data, mutt_strlen(t->data)) == 0) || *t->data == '*') return true; } return false; @@ -663,7 +663,7 @@ bool mutt_needs_mailcap(struct Body *m) switch (m->type) { case TYPETEXT: - if (ascii_strcasecmp("plain", m->subtype) == 0) + if (mutt_strcasecmp("plain", m->subtype) == 0) return false; break; case TYPEAPPLICATION: @@ -694,13 +694,13 @@ bool mutt_is_text_part(struct Body *b) if (t == TYPEMESSAGE) { - if (ascii_strcasecmp("delivery-status", s) == 0) + if (mutt_strcasecmp("delivery-status", s) == 0) return true; } if ((WithCrypto & APPLICATION_PGP) && t == TYPEAPPLICATION) { - if (ascii_strcasecmp("pgp-keys", s) == 0) + if (mutt_strcasecmp("pgp-keys", s) == 0) return true; } diff --git a/mx.c b/mx.c index a31fbd159..d6c6d135a 100644 --- a/mx.c +++ b/mx.c @@ -463,13 +463,13 @@ int mx_get_magic(const char *path) */ int mx_set_magic(const char *s) { - if (ascii_strcasecmp(s, "mbox") == 0) + if (mutt_strcasecmp(s, "mbox") == 0) DefaultMagic = MUTT_MBOX; - else if (ascii_strcasecmp(s, "mmdf") == 0) + else if (mutt_strcasecmp(s, "mmdf") == 0) DefaultMagic = MUTT_MMDF; - else if (ascii_strcasecmp(s, "mh") == 0) + else if (mutt_strcasecmp(s, "mh") == 0) DefaultMagic = MUTT_MH; - else if (ascii_strcasecmp(s, "maildir") == 0) + else if (mutt_strcasecmp(s, "maildir") == 0) DefaultMagic = MUTT_MAILDIR; else return -1; diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index d858d13ab..bd9918f83 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -149,7 +149,7 @@ int mutt_protect(struct Header *msg, char *keylist) if ((WithCrypto & APPLICATION_PGP) && ((msg->security & PGPINLINE) == PGPINLINE)) { if ((msg->content->type != TYPETEXT) || - (ascii_strcasecmp(msg->content->subtype, "plain") != 0)) + (mutt_strcasecmp(msg->content->subtype, "plain") != 0)) { if (query_quadoption(OPT_PGP_MIME_AUTO, _("Inline PGP can't be used with attachments. " @@ -302,24 +302,24 @@ int mutt_is_multipart_signed(struct Body *b) char *p = NULL; if (!b || !(b->type == TYPEMULTIPART) || !b->subtype || - (ascii_strcasecmp(b->subtype, "signed") != 0)) + (mutt_strcasecmp(b->subtype, "signed") != 0)) return 0; if (!(p = mutt_get_parameter("protocol", b->parameter))) return 0; - if (!(ascii_strcasecmp(p, "multipart/mixed") != 0)) + if (!(mutt_strcasecmp(p, "multipart/mixed") != 0)) return SIGN; if ((WithCrypto & APPLICATION_PGP) && - !(ascii_strcasecmp(p, "application/pgp-signature") != 0)) + !(mutt_strcasecmp(p, "application/pgp-signature") != 0)) return PGPSIGN; if ((WithCrypto & APPLICATION_SMIME) && - !(ascii_strcasecmp(p, "application/x-pkcs7-signature") != 0)) + !(mutt_strcasecmp(p, "application/x-pkcs7-signature") != 0)) return SMIMESIGN; if ((WithCrypto & APPLICATION_SMIME) && - !(ascii_strcasecmp(p, "application/pkcs7-signature") != 0)) + !(mutt_strcasecmp(p, "application/pkcs7-signature") != 0)) return SMIMESIGN; return 0; @@ -332,9 +332,9 @@ int mutt_is_multipart_encrypted(struct Body *b) char *p = NULL; if (!b || b->type != TYPEMULTIPART || !b->subtype || - (ascii_strcasecmp(b->subtype, "encrypted") != 0) || + (mutt_strcasecmp(b->subtype, "encrypted") != 0) || !(p = mutt_get_parameter("protocol", b->parameter)) || - (ascii_strcasecmp(p, "application/pgp-encrypted") != 0)) + (mutt_strcasecmp(p, "application/pgp-encrypted") != 0)) return 0; return PGPENCRYPT; @@ -350,12 +350,12 @@ int mutt_is_valid_multipart_pgp_encrypted(struct Body *b) b = b->parts; if (!b || b->type != TYPEAPPLICATION || !b->subtype || - (ascii_strcasecmp(b->subtype, "pgp-encrypted") != 0)) + (mutt_strcasecmp(b->subtype, "pgp-encrypted") != 0)) return 0; b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || - (ascii_strcasecmp(b->subtype, "octet-stream") != 0)) + (mutt_strcasecmp(b->subtype, "octet-stream") != 0)) return 0; return PGPENCRYPT; @@ -380,22 +380,22 @@ int mutt_is_malformed_multipart_pgp_encrypted(struct Body *b) return 0; if (!b || b->type != TYPEMULTIPART || !b->subtype || - (ascii_strcasecmp(b->subtype, "mixed") != 0)) + (mutt_strcasecmp(b->subtype, "mixed") != 0)) return 0; b = b->parts; if (!b || b->type != TYPETEXT || !b->subtype || - (ascii_strcasecmp(b->subtype, "plain") != 0) || b->length != 0) + (mutt_strcasecmp(b->subtype, "plain") != 0) || b->length != 0) return 0; b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || - (ascii_strcasecmp(b->subtype, "pgp-encrypted") != 0)) + (mutt_strcasecmp(b->subtype, "pgp-encrypted") != 0)) return 0; b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || - (ascii_strcasecmp(b->subtype, "octet-stream") != 0)) + (mutt_strcasecmp(b->subtype, "octet-stream") != 0)) return 0; b = b->next; @@ -412,38 +412,38 @@ int mutt_is_application_pgp(struct Body *m) if (m->type == TYPEAPPLICATION) { - if ((ascii_strcasecmp(m->subtype, "pgp") == 0) || - (ascii_strcasecmp(m->subtype, "x-pgp-message") == 0)) + if ((mutt_strcasecmp(m->subtype, "pgp") == 0) || + (mutt_strcasecmp(m->subtype, "x-pgp-message") == 0)) { if ((p = mutt_get_parameter("x-action", m->parameter)) && - ((ascii_strcasecmp(p, "sign") == 0) || - (ascii_strcasecmp(p, "signclear") == 0))) + ((mutt_strcasecmp(p, "sign") == 0) || + (mutt_strcasecmp(p, "signclear") == 0))) t |= PGPSIGN; if ((p = mutt_get_parameter("format", m->parameter)) && - (ascii_strcasecmp(p, "keys-only") == 0)) + (mutt_strcasecmp(p, "keys-only") == 0)) t |= PGPKEY; if (!t) t |= PGPENCRYPT; /* not necessarily correct, but... */ } - if (ascii_strcasecmp(m->subtype, "pgp-signed") == 0) + if (mutt_strcasecmp(m->subtype, "pgp-signed") == 0) t |= PGPSIGN; - if (ascii_strcasecmp(m->subtype, "pgp-keys") == 0) + if (mutt_strcasecmp(m->subtype, "pgp-keys") == 0) t |= PGPKEY; } - else if (m->type == TYPETEXT && (ascii_strcasecmp("plain", m->subtype) == 0)) + else if (m->type == TYPETEXT && (mutt_strcasecmp("plain", m->subtype) == 0)) { if (((p = mutt_get_parameter("x-mutt-action", m->parameter)) || (p = mutt_get_parameter("x-action", m->parameter)) || (p = mutt_get_parameter("action", m->parameter))) && - (ascii_strncasecmp("pgp-sign", p, 8) == 0)) + (mutt_strncasecmp("pgp-sign", p, 8) == 0)) t |= PGPSIGN; - else if (p && (ascii_strncasecmp("pgp-encrypt", p, 11) == 0)) + else if (p && (mutt_strncasecmp("pgp-encrypt", p, 11) == 0)) t |= PGPENCRYPT; - else if (p && (ascii_strncasecmp("pgp-keys", p, 7) == 0)) + else if (p && (mutt_strncasecmp("pgp-keys", p, 7) == 0)) t |= PGPKEY; } if (t) @@ -464,14 +464,14 @@ int mutt_is_application_smime(struct Body *m) if ((m->type & TYPEAPPLICATION) && m->subtype) { /* S/MIME MIME types don't need x- anymore, see RFC2311 */ - if ((ascii_strcasecmp(m->subtype, "x-pkcs7-mime") == 0) || - (ascii_strcasecmp(m->subtype, "pkcs7-mime") == 0)) + if ((mutt_strcasecmp(m->subtype, "x-pkcs7-mime") == 0) || + (mutt_strcasecmp(m->subtype, "pkcs7-mime") == 0)) { if ((t = mutt_get_parameter("smime-type", m->parameter))) { - if (ascii_strcasecmp(t, "enveloped-data") == 0) + if (mutt_strcasecmp(t, "enveloped-data") == 0) return SMIMEENCRYPT; - else if (ascii_strcasecmp(t, "signed-data") == 0) + else if (mutt_strcasecmp(t, "signed-data") == 0) return (SMIMESIGN | SMIMEOPAQUE); else return 0; @@ -480,11 +480,11 @@ int mutt_is_application_smime(struct Body *m) * Content-Description: S/MIME Encrypted Message * instead of Content-Type parameter */ - if (ascii_strcasecmp(m->description, "S/MIME Encrypted Message") == 0) + if (mutt_strcasecmp(m->description, "S/MIME Encrypted Message") == 0) return SMIMEENCRYPT; complain = true; } - else if (ascii_strcasecmp(m->subtype, "octet-stream") != 0) + else if (mutt_strcasecmp(m->subtype, "octet-stream") != 0) return 0; t = mutt_get_parameter("name", m->parameter); @@ -507,11 +507,11 @@ int mutt_is_application_smime(struct Body *m) if (len > 0 && *(t + len) == '.') { len++; - if (ascii_strcasecmp((t + len), "p7m") == 0) + if (mutt_strcasecmp((t + len), "p7m") == 0) /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ return (SMIMESIGN | SMIMEOPAQUE); - else if (ascii_strcasecmp((t + len), "p7s") == 0) + else if (mutt_strcasecmp((t + len), "p7s") == 0) return (SMIMESIGN | SMIMEOPAQUE); } } @@ -654,7 +654,7 @@ void convert_to_7bit(struct Body *a) convert_to_7bit(a->parts); } else if (a->type == TYPEMESSAGE && - (ascii_strcasecmp(a->subtype, "delivery-status") != 0)) + (mutt_strcasecmp(a->subtype, "delivery-status") != 0)) { if (a->encoding != ENC7BIT) mutt_message_to_7bit(a, NULL); @@ -948,18 +948,18 @@ int mutt_signed_handler(struct Body *a, struct State *s) { case SIGN: if (a->next->type != TYPEMULTIPART || - (ascii_strcasecmp(a->next->subtype, "mixed") != 0)) + (mutt_strcasecmp(a->next->subtype, "mixed") != 0)) inconsistent = true; break; case PGPSIGN: if (a->next->type != TYPEAPPLICATION || - (ascii_strcasecmp(a->next->subtype, "pgp-signature") != 0)) + (mutt_strcasecmp(a->next->subtype, "pgp-signature") != 0)) inconsistent = true; break; case SMIMESIGN: if (a->next->type != TYPEAPPLICATION || - ((ascii_strcasecmp(a->next->subtype, "x-pkcs7-signature") != 0) && - (ascii_strcasecmp(a->next->subtype, "pkcs7-signature") != 0))) + ((mutt_strcasecmp(a->next->subtype, "x-pkcs7-signature") != 0) && + (mutt_strcasecmp(a->next->subtype, "pkcs7-signature") != 0))) inconsistent = true; break; default: @@ -986,7 +986,7 @@ int mutt_signed_handler(struct Body *a, struct State *s) for (i = 0; i < sigcnt; i++) { if ((WithCrypto & APPLICATION_PGP) && signatures[i]->type == TYPEAPPLICATION && - (ascii_strcasecmp(signatures[i]->subtype, "pgp-signature") == 0)) + (mutt_strcasecmp(signatures[i]->subtype, "pgp-signature") == 0)) { if (crypt_pgp_verify_one(signatures[i], s, tempfile) != 0) goodsig = false; @@ -995,8 +995,8 @@ int mutt_signed_handler(struct Body *a, struct State *s) } if ((WithCrypto & APPLICATION_SMIME) && signatures[i]->type == TYPEAPPLICATION && - ((ascii_strcasecmp(signatures[i]->subtype, "x-pkcs7-signature") == 0) || - (ascii_strcasecmp(signatures[i]->subtype, "pkcs7-signature") == 0))) + ((mutt_strcasecmp(signatures[i]->subtype, "x-pkcs7-signature") == 0) || + (mutt_strcasecmp(signatures[i]->subtype, "pkcs7-signature") == 0))) { if (crypt_smime_verify_one(signatures[i], s, tempfile) != 0) goodsig = false; diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index d6d7c4e98..71ab3d71b 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -897,6 +897,12 @@ static char *encrypt_gpgme_object(gpgme_data_t plaintext, gpgme_key_t *rset, return outfile; } +static void strlower(char *s) +{ + for (; *s; ++s) + *s = tolower(*s); +} + /** * get_micalg - Find the "micalg" parameter from the last GPGME operation * @@ -925,13 +931,13 @@ static int get_micalg(gpgme_ctx_t ctx, int use_smime, char *buf, size_t buflen) { /* convert GPGME raw hash name to RFC2633 format */ snprintf(buf, buflen, "%s", algorithm_name); - ascii_strlower(buf); + strlower(buf); } else { /* convert GPGME raw hash name to RFC3156 format */ snprintf(buf, buflen, "pgp-%s", algorithm_name); - ascii_strlower(buf + 4); + strlower(buf + 4); } } } diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 28bb2813b..5e0e8bb55 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1485,7 +1485,7 @@ struct Body *pgp_traditional_encryptsign(struct Body *a, int flags, char *keylis if (a->type != TYPETEXT) return NULL; - if (ascii_strcasecmp(a->subtype, "plain") != 0) + if (mutt_strcasecmp(a->subtype, "plain") != 0) return NULL; if ((fp = fopen(a->filename, "r")) == NULL) diff --git a/ncrypt/smime.c b/ncrypt/smime.c index bf97dd3b1..a94ea686e 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -1684,7 +1684,7 @@ int smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile) rewind(smimeerr); line = mutt_read_line(line, &linelen, smimeerr, &lineno, 0); - if (linelen && (ascii_strcasecmp(line, "verification successful") == 0)) + if (linelen && (mutt_strcasecmp(line, "verification successful") == 0)) badsig = 0; FREE(&line); @@ -1901,7 +1901,7 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o rewind(smimeerr); line = mutt_read_line(line, &linelen, smimeerr, &lineno, 0); - if (linelen && (ascii_strcasecmp(line, "verification successful") == 0)) + if (linelen && (mutt_strcasecmp(line, "verification successful") == 0)) m->goodsig = true; FREE(&line); } diff --git a/parameter.c b/parameter.c index c3432a1c5..da96b92b8 100644 --- a/parameter.c +++ b/parameter.c @@ -42,7 +42,7 @@ void mutt_free_parameter(struct Parameter **p) char *mutt_get_parameter(const char *s, struct Parameter *p) { for (; p; p = p->next) - if (ascii_strcasecmp(s, p->attribute) == 0) + if (mutt_strcasecmp(s, p->attribute) == 0) return p->value; return NULL; @@ -60,7 +60,7 @@ void mutt_set_parameter(const char *attribute, const char *value, struct Paramet for (q = *p; q; q = q->next) { - if (ascii_strcasecmp(attribute, q->attribute) == 0) + if (mutt_strcasecmp(attribute, q->attribute) == 0) { mutt_str_replace(&q->value, value); return; @@ -80,7 +80,7 @@ void mutt_delete_parameter(const char *attribute, struct Parameter **p) for (q = *p; q; p = &q->next, q = q->next) { - if (ascii_strcasecmp(attribute, q->attribute) == 0) + if (mutt_strcasecmp(attribute, q->attribute) == 0) { *p = q->next; q->next = NULL; diff --git a/parse.c b/parse.c index 24b9c9b3f..411ea0f30 100644 --- a/parse.c +++ b/parse.c @@ -136,20 +136,20 @@ static struct List *parse_references(char *s, int in_reply_to) int mutt_check_encoding(const char *c) { - if (ascii_strncasecmp("7bit", c, sizeof("7bit") - 1) == 0) + if (mutt_strncasecmp("7bit", c, sizeof("7bit") - 1) == 0) return ENC7BIT; - else if (ascii_strncasecmp("8bit", c, sizeof("8bit") - 1) == 0) + else if (mutt_strncasecmp("8bit", c, sizeof("8bit") - 1) == 0) return ENC8BIT; - else if (ascii_strncasecmp("binary", c, sizeof("binary") - 1) == 0) + else if (mutt_strncasecmp("binary", c, sizeof("binary") - 1) == 0) return ENCBINARY; - else if (ascii_strncasecmp("quoted-printable", c, sizeof("quoted-printable") - 1) == 0) + else if (mutt_strncasecmp("quoted-printable", c, sizeof("quoted-printable") - 1) == 0) return ENCQUOTEDPRINTABLE; - else if (ascii_strncasecmp("base64", c, sizeof("base64") - 1) == 0) + else if (mutt_strncasecmp("base64", c, sizeof("base64") - 1) == 0) return ENCBASE64; - else if (ascii_strncasecmp("x-uuencode", c, sizeof("x-uuencode") - 1) == 0) + else if (mutt_strncasecmp("x-uuencode", c, sizeof("x-uuencode") - 1) == 0) return ENCUUENCODED; #ifdef SUN_ATTACHMENT - else if (ascii_strncasecmp("uuencode", c, sizeof("uuencode") - 1) == 0) + else if (mutt_strncasecmp("uuencode", c, sizeof("uuencode") - 1) == 0) return ENCUUENCODED; #endif else @@ -281,29 +281,29 @@ bail: int mutt_check_mime_type(const char *s) { - if (ascii_strcasecmp("text", s) == 0) + if (mutt_strcasecmp("text", s) == 0) return TYPETEXT; - else if (ascii_strcasecmp("multipart", s) == 0) + else if (mutt_strcasecmp("multipart", s) == 0) return TYPEMULTIPART; #ifdef SUN_ATTACHMENT - else if (ascii_strcasecmp("x-sun-attachment", s) == 0) + else if (mutt_strcasecmp("x-sun-attachment", s) == 0) return TYPEMULTIPART; #endif - else if (ascii_strcasecmp("application", s) == 0) + else if (mutt_strcasecmp("application", s) == 0) return TYPEAPPLICATION; - else if (ascii_strcasecmp("message", s) == 0) + else if (mutt_strcasecmp("message", s) == 0) return TYPEMESSAGE; - else if (ascii_strcasecmp("image", s) == 0) + else if (mutt_strcasecmp("image", s) == 0) return TYPEIMAGE; - else if (ascii_strcasecmp("audio", s) == 0) + else if (mutt_strcasecmp("audio", s) == 0) return TYPEAUDIO; - else if (ascii_strcasecmp("video", s) == 0) + else if (mutt_strcasecmp("video", s) == 0) return TYPEVIDEO; - else if (ascii_strcasecmp("model", s) == 0) + else if (mutt_strcasecmp("model", s) == 0) return TYPEMODEL; - else if (ascii_strcasecmp("*", s) == 0) + else if (mutt_strcasecmp("*", s) == 0) return TYPEANY; - else if (ascii_strcasecmp(".*", s) == 0) + else if (mutt_strcasecmp(".*", s) == 0) return TYPEANY; else return TYPEOTHER; @@ -352,7 +352,7 @@ void mutt_parse_content_type(char *s, struct Body *ct) ct->type = mutt_check_mime_type(s); #ifdef SUN_ATTACHMENT - if (ascii_strcasecmp("x-sun-attachment", s) == 0) + if (mutt_strcasecmp("x-sun-attachment", s) == 0) ct->subtype = safe_strdup("x-sun-attachment"); #endif @@ -400,9 +400,9 @@ static void parse_content_disposition(const char *s, struct Body *ct) { struct Parameter *parms = NULL; - if (ascii_strncasecmp("inline", s, 6) == 0) + if (mutt_strncasecmp("inline", s, 6) == 0) ct->disposition = DISPINLINE; - else if (ascii_strncasecmp("form-data", s, 9) == 0) + else if (mutt_strncasecmp("form-data", s, 9) == 0) ct->disposition = DISPFORMDATA; else ct->disposition = DISPATTACH; @@ -457,30 +457,30 @@ struct Body *mutt_read_mime_header(FILE *fp, int digest) break; } - if (ascii_strncasecmp("content-", line, 8) == 0) + if (mutt_strncasecmp("content-", line, 8) == 0) { - if (ascii_strcasecmp("type", line + 8) == 0) + if (mutt_strcasecmp("type", line + 8) == 0) mutt_parse_content_type(c, p); - else if (ascii_strcasecmp("transfer-encoding", line + 8) == 0) + else if (mutt_strcasecmp("transfer-encoding", line + 8) == 0) p->encoding = mutt_check_encoding(c); - else if (ascii_strcasecmp("disposition", line + 8) == 0) + else if (mutt_strcasecmp("disposition", line + 8) == 0) parse_content_disposition(c, p); - else if (ascii_strcasecmp("description", line + 8) == 0) + else if (mutt_strcasecmp("description", line + 8) == 0) { mutt_str_replace(&p->description, c); rfc2047_decode(&p->description); } } #ifdef SUN_ATTACHMENT - else if (ascii_strncasecmp("x-sun-", line, 6) == 0) + else if (mutt_strncasecmp("x-sun-", line, 6) == 0) { - if (ascii_strcasecmp("data-type", line + 6) == 0) + if (mutt_strcasecmp("data-type", line + 6) == 0) mutt_parse_content_type(c, p); - else if (ascii_strcasecmp("encoding-info", line + 6) == 0) + else if (mutt_strcasecmp("encoding-info", line + 6) == 0) p->encoding = mutt_check_encoding(c); - else if (ascii_strcasecmp("content-lines", line + 6) == 0) + else if (mutt_strcasecmp("content-lines", line + 6) == 0) mutt_set_parameter("content-lines", c, &(p->parameter)); - else if (ascii_strcasecmp("data-description", line + 6) == 0) + else if (mutt_strcasecmp("data-description", line + 6) == 0) { mutt_str_replace(&p->description, c); rfc2047_decode(&p->description); @@ -507,7 +507,7 @@ void mutt_parse_part(FILE *fp, struct Body *b) { case TYPEMULTIPART: #ifdef SUN_ATTACHMENT - if (ascii_strcasecmp(b->subtype, "x-sun-attachment") == 0) + if (mutt_strcasecmp(b->subtype, "x-sun-attachment") == 0) bound = "--------"; else #endif @@ -515,7 +515,7 @@ void mutt_parse_part(FILE *fp, struct Body *b) fseeko(fp, b->offset, SEEK_SET); b->parts = mutt_parse_multipart(fp, bound, b->offset + b->length, - (ascii_strcasecmp("digest", b->subtype) == 0)); + (mutt_strcasecmp("digest", b->subtype) == 0)); break; case TYPEMESSAGE: @@ -524,7 +524,7 @@ void mutt_parse_part(FILE *fp, struct Body *b) fseeko(fp, b->offset, SEEK_SET); if (mutt_is_message_type(b->type, b->subtype)) b->parts = mutt_parse_message_rfc822(fp, b); - else if (ascii_strcasecmp(b->subtype, "external-body") == 0) + else if (mutt_strcasecmp(b->subtype, "external-body") == 0) b->parts = mutt_read_mime_header(fp, 0); else return; @@ -855,7 +855,7 @@ time_t mutt_parse_date(const char *s, struct Header *h) struct Tz *tz = NULL; tz = bsearch(ptz, TimeZones, sizeof(TimeZones) / sizeof(struct Tz), - sizeof(struct Tz), (int (*)(const void *, const void *)) ascii_strcasecmp + sizeof(struct Tz), (int (*)(const void *, const void *)) mutt_strcasecmp /* This is safe to do: A pointer to a struct equals * a pointer to its first element */); @@ -867,11 +867,11 @@ time_t mutt_parse_date(const char *s, struct Header *h) } /* ad hoc support for the European MET (now officially CET) TZ */ - if (ascii_strcasecmp(t, "MET") == 0) + if (mutt_strcasecmp(t, "MET") == 0) { if ((t = strtok(NULL, " \t")) != NULL) { - if (ascii_strcasecmp(t, "DST") == 0) + if (mutt_strcasecmp(t, "DST") == 0) zhours++; } } @@ -1003,12 +1003,12 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, switch (tolower(line[0])) { case 'a': - if (ascii_strcasecmp(line + 1, "pparently-to") == 0) + if (mutt_strcasecmp(line + 1, "pparently-to") == 0) { e->to = rfc822_parse_adrlist(e->to, p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "pparently-from") == 0) + else if (mutt_strcasecmp(line + 1, "pparently-from") == 0) { e->from = rfc822_parse_adrlist(e->from, p); matched = 1; @@ -1016,7 +1016,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'b': - if (ascii_strcasecmp(line + 1, "cc") == 0) + if (mutt_strcasecmp(line + 1, "cc") == 0) { e->bcc = rfc822_parse_adrlist(e->bcc, p); matched = 1; @@ -1024,26 +1024,26 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'c': - if (ascii_strcasecmp(line + 1, "c") == 0) + if (mutt_strcasecmp(line + 1, "c") == 0) { e->cc = rfc822_parse_adrlist(e->cc, p); matched = 1; } - else if (ascii_strncasecmp(line + 1, "ontent-", 7) == 0) + else if (mutt_strncasecmp(line + 1, "ontent-", 7) == 0) { - if (ascii_strcasecmp(line + 8, "type") == 0) + if (mutt_strcasecmp(line + 8, "type") == 0) { if (hdr) mutt_parse_content_type(p, hdr->content); matched = 1; } - else if (ascii_strcasecmp(line + 8, "transfer-encoding") == 0) + else if (mutt_strcasecmp(line + 8, "transfer-encoding") == 0) { if (hdr) hdr->content->encoding = mutt_check_encoding(p); matched = 1; } - else if (ascii_strcasecmp(line + 8, "length") == 0) + else if (mutt_strcasecmp(line + 8, "length") == 0) { if (hdr) { @@ -1052,7 +1052,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, } matched = 1; } - else if (ascii_strcasecmp(line + 8, "description") == 0) + else if (mutt_strcasecmp(line + 8, "description") == 0) { if (hdr) { @@ -1061,7 +1061,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, } matched = 1; } - else if (ascii_strcasecmp(line + 8, "disposition") == 0) + else if (mutt_strcasecmp(line + 8, "disposition") == 0) { if (hdr) parse_content_disposition(p, hdr->content); @@ -1071,7 +1071,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'd': - if (ascii_strcasecmp("ate", line + 1) == 0) + if (mutt_strcasecmp("ate", line + 1) == 0) { mutt_str_replace(&e->date, p); if (hdr) @@ -1081,19 +1081,19 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'e': - if ((ascii_strcasecmp("xpires", line + 1) == 0) && hdr && + if ((mutt_strcasecmp("xpires", line + 1) == 0) && hdr && mutt_parse_date(p, NULL) < time(NULL)) hdr->expired = true; break; case 'f': - if (ascii_strcasecmp("rom", line + 1) == 0) + if (mutt_strcasecmp("rom", line + 1) == 0) { e->from = rfc822_parse_adrlist(e->from, p); matched = 1; } #ifdef USE_NNTP - else if (ascii_strcasecmp(line + 1, "ollowup-to") == 0) + else if (mutt_strcasecmp(line + 1, "ollowup-to") == 0) { if (!e->followup_to) { @@ -1106,7 +1106,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'i': - if (ascii_strcasecmp(line + 1, "n-reply-to") == 0) + if (mutt_strcasecmp(line + 1, "n-reply-to") == 0) { mutt_free_list(&e->in_reply_to); e->in_reply_to = parse_references(p, 1); @@ -1115,7 +1115,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'l': - if (ascii_strcasecmp(line + 1, "ines") == 0) + if (mutt_strcasecmp(line + 1, "ines") == 0) { if (hdr) { @@ -1129,7 +1129,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, matched = 1; } - else if (ascii_strcasecmp(line + 1, "ist-Post") == 0) + else if (mutt_strcasecmp(line + 1, "ist-Post") == 0) { /* RFC2369. FIXME: We should ignore whitespace, but don't. */ if (strncmp(p, "NO", 2) != 0) @@ -1155,29 +1155,29 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'm': - if (ascii_strcasecmp(line + 1, "ime-version") == 0) + if (mutt_strcasecmp(line + 1, "ime-version") == 0) { if (hdr) hdr->mime = true; matched = 1; } - else if (ascii_strcasecmp(line + 1, "essage-id") == 0) + else if (mutt_strcasecmp(line + 1, "essage-id") == 0) { /* We add a new "Message-ID:" when building a message */ FREE(&e->message_id); e->message_id = mutt_extract_message_id(p, NULL); matched = 1; } - else if (ascii_strncasecmp(line + 1, "ail-", 4) == 0) + else if (mutt_strncasecmp(line + 1, "ail-", 4) == 0) { - if (ascii_strcasecmp(line + 5, "reply-to") == 0) + if (mutt_strcasecmp(line + 5, "reply-to") == 0) { /* override the Reply-To: field */ rfc822_free_address(&e->reply_to); e->reply_to = rfc822_parse_adrlist(e->reply_to, p); matched = 1; } - else if (ascii_strcasecmp(line + 5, "followup-to") == 0) + else if (mutt_strcasecmp(line + 5, "followup-to") == 0) { e->mail_followup_to = rfc822_parse_adrlist(e->mail_followup_to, p); matched = 1; @@ -1187,7 +1187,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, #ifdef USE_NNTP case 'n': - if (ascii_strcasecmp(line + 1, "ewsgroups") == 0) + if (mutt_strcasecmp(line + 1, "ewsgroups") == 0) { FREE(&e->newsgroups); mutt_remove_trailing_ws(p); @@ -1199,31 +1199,31 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, case 'o': /* field `Organization:' saves only for pager! */ - if (ascii_strcasecmp(line + 1, "rganization") == 0) + if (mutt_strcasecmp(line + 1, "rganization") == 0) { - if (!e->organization && (ascii_strcasecmp(p, "unknown") != 0)) + if (!e->organization && (mutt_strcasecmp(p, "unknown") != 0)) e->organization = safe_strdup(p); } break; case 'r': - if (ascii_strcasecmp(line + 1, "eferences") == 0) + if (mutt_strcasecmp(line + 1, "eferences") == 0) { mutt_free_list(&e->references); e->references = parse_references(p, 0); matched = 1; } - else if (ascii_strcasecmp(line + 1, "eply-to") == 0) + else if (mutt_strcasecmp(line + 1, "eply-to") == 0) { e->reply_to = rfc822_parse_adrlist(e->reply_to, p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "eturn-path") == 0) + else if (mutt_strcasecmp(line + 1, "eturn-path") == 0) { e->return_path = rfc822_parse_adrlist(e->return_path, p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "eceived") == 0) + else if (mutt_strcasecmp(line + 1, "eceived") == 0) { if (hdr && !hdr->received) { @@ -1236,18 +1236,18 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 's': - if (ascii_strcasecmp(line + 1, "ubject") == 0) + if (mutt_strcasecmp(line + 1, "ubject") == 0) { if (!e->subject) e->subject = safe_strdup(p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "ender") == 0) + else if (mutt_strcasecmp(line + 1, "ender") == 0) { e->sender = rfc822_parse_adrlist(e->sender, p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "tatus") == 0) + else if (mutt_strcasecmp(line + 1, "tatus") == 0) { if (hdr) { @@ -1270,8 +1270,8 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, } matched = 1; } - else if (((ascii_strcasecmp("upersedes", line + 1) == 0) || - (ascii_strcasecmp("upercedes", line + 1) == 0)) && + else if (((mutt_strcasecmp("upersedes", line + 1) == 0) || + (mutt_strcasecmp("upercedes", line + 1) == 0)) && hdr) { FREE(&e->supersedes); @@ -1280,7 +1280,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 't': - if (ascii_strcasecmp(line + 1, "o") == 0) + if (mutt_strcasecmp(line + 1, "o") == 0) { e->to = rfc822_parse_adrlist(e->to, p); matched = 1; @@ -1288,7 +1288,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, break; case 'x': - if (ascii_strcasecmp(line + 1, "-status") == 0) + if (mutt_strcasecmp(line + 1, "-status") == 0) { if (hdr) { @@ -1313,27 +1313,27 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, } matched = 1; } - else if (ascii_strcasecmp(line + 1, "-label") == 0) + else if (mutt_strcasecmp(line + 1, "-label") == 0) { FREE(&e->x_label); e->x_label = safe_strdup(p); matched = 1; } #ifdef USE_NNTP - else if (ascii_strcasecmp(line + 1, "-comment-to") == 0) + else if (mutt_strcasecmp(line + 1, "-comment-to") == 0) { if (!e->x_comment_to) e->x_comment_to = safe_strdup(p); matched = 1; } - else if (ascii_strcasecmp(line + 1, "ref") == 0) + else if (mutt_strcasecmp(line + 1, "ref") == 0) { if (!e->xref) e->xref = safe_strdup(p); matched = 1; } #endif - else if (ascii_strcasecmp(line + 1, "-original-to") == 0) + else if (mutt_strcasecmp(line + 1, "-original-to") == 0) { e->x_original_to = rfc822_parse_adrlist(e->x_original_to, p); matched = 1; @@ -1629,7 +1629,7 @@ static int count_body_parts(struct Body *body, int flags) shallrecurse = true; /* If it's an external body pointer, don't recurse it. */ - if (ascii_strcasecmp(bp->subtype, "external-body") == 0) + if (mutt_strcasecmp(bp->subtype, "external-body") == 0) shallrecurse = false; /* Don't count containers if they're top-level. */ @@ -1640,7 +1640,7 @@ static int count_body_parts(struct Body *body, int flags) { /* Always recurse multiparts, except multipart/alternative. */ shallrecurse = true; - if (ascii_strcasecmp(bp->subtype, "alternative") == 0) + if (mutt_strcasecmp(bp->subtype, "alternative") == 0) shallrecurse = false; /* Don't count containers if they're top-level. */ diff --git a/pattern.c b/pattern.c index 890359e23..83c3133d6 100644 --- a/pattern.c +++ b/pattern.c @@ -1776,31 +1776,31 @@ void mutt_check_simple(char *s, size_t len, const char *simple) } } - /* XXX - is ascii_strcasecmp() right here, or should we use locale's + /* XXX - is mutt_strcasecmp() right here, or should we use locale's * equivalences? */ if (do_simple) /* yup, so spoof a real request */ { /* convert old tokens into the new format */ - if ((ascii_strcasecmp("all", s) == 0) || (mutt_strcmp("^", s) == 0) || + if ((mutt_strcasecmp("all", s) == 0) || (mutt_strcmp("^", s) == 0) || (mutt_strcmp(".", s) == 0)) /* ~A is more efficient */ strfcpy(s, "~A", len); - else if (ascii_strcasecmp("del", s) == 0) + else if (mutt_strcasecmp("del", s) == 0) strfcpy(s, "~D", len); - else if (ascii_strcasecmp("flag", s) == 0) + else if (mutt_strcasecmp("flag", s) == 0) strfcpy(s, "~F", len); - else if (ascii_strcasecmp("new", s) == 0) + else if (mutt_strcasecmp("new", s) == 0) strfcpy(s, "~N", len); - else if (ascii_strcasecmp("old", s) == 0) + else if (mutt_strcasecmp("old", s) == 0) strfcpy(s, "~O", len); - else if (ascii_strcasecmp("repl", s) == 0) + else if (mutt_strcasecmp("repl", s) == 0) strfcpy(s, "~Q", len); - else if (ascii_strcasecmp("read", s) == 0) + else if (mutt_strcasecmp("read", s) == 0) strfcpy(s, "~R", len); - else if (ascii_strcasecmp("tag", s) == 0) + else if (mutt_strcasecmp("tag", s) == 0) strfcpy(s, "~T", len); - else if (ascii_strcasecmp("unread", s) == 0) + else if (mutt_strcasecmp("unread", s) == 0) strfcpy(s, "~U", len); else { diff --git a/po/POTFILES.in b/po/POTFILES.in index bce6415a2..fff851a1c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -55,7 +55,6 @@ imap/util.c init.c keymap.c keymap_alldefs.h -lib/ascii.c lib/base64.c lib/buffer.c lib/date.c diff --git a/pop_auth.c b/pop_auth.c index 640a3df22..f97447645 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -363,7 +363,7 @@ int pop_authenticate(struct PopData *pop_data) while (authenticator->authenticate) { - if (!authenticator->method || (ascii_strcasecmp(authenticator->method, method) == 0)) + if (!authenticator->method || (mutt_strcasecmp(authenticator->method, method) == 0)) { ret = authenticator->authenticate(pop_data, method); if (ret == POP_A_SOCKET) diff --git a/pop_lib.c b/pop_lib.c index 4c021ebbe..4bd71d2c1 100644 --- a/pop_lib.c +++ b/pop_lib.c @@ -127,23 +127,23 @@ static int fetch_capa(char *line, void *data) struct PopData *pop_data = (struct PopData *) data; char *c = NULL; - if (ascii_strncasecmp(line, "SASL", 4) == 0) + if (mutt_strncasecmp(line, "SASL", 4) == 0) { FREE(&pop_data->auth_list); c = skip_email_wsp(line + 4); pop_data->auth_list = safe_strdup(c); } - else if (ascii_strncasecmp(line, "STLS", 4) == 0) + else if (mutt_strncasecmp(line, "STLS", 4) == 0) pop_data->cmd_stls = true; - else if (ascii_strncasecmp(line, "USER", 4) == 0) + else if (mutt_strncasecmp(line, "USER", 4) == 0) pop_data->cmd_user = 1; - else if (ascii_strncasecmp(line, "UIDL", 4) == 0) + else if (mutt_strncasecmp(line, "UIDL", 4) == 0) pop_data->cmd_uidl = 1; - else if (ascii_strncasecmp(line, "TOP", 3) == 0) + else if (mutt_strncasecmp(line, "TOP", 3) == 0) pop_data->cmd_top = 1; return 0; diff --git a/postpone.c b/postpone.c index d681c8342..0f0a3f835 100644 --- a/postpone.c +++ b/postpone.c @@ -324,7 +324,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, for (tmp = hdr->env->userhdrs; tmp;) { - if (ascii_strncasecmp("X-Mutt-References:", tmp->data, 18) == 0) + if (mutt_strncasecmp("X-Mutt-References:", tmp->data, 18) == 0) { if (ctx) { @@ -348,7 +348,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, if (*cur) code |= SENDREPLY; } - else if (ascii_strncasecmp("X-Mutt-Fcc:", tmp->data, 11) == 0) + else if (mutt_strncasecmp("X-Mutt-Fcc:", tmp->data, 11) == 0) { p = skip_email_wsp(tmp->data + 11); strfcpy(fcc, p, fcclen); @@ -642,7 +642,7 @@ err: { newhdr->security |= SIGN; if ((WithCrypto & APPLICATION_PGP) && - (ascii_strcasecmp(mutt_get_parameter("protocol", newhdr->content->parameter), + (mutt_strcasecmp(mutt_get_parameter("protocol", newhdr->content->parameter), "application/pgp-signature") == 0)) newhdr->security |= APPLICATION_PGP; else if ((WithCrypto & APPLICATION_SMIME)) @@ -693,7 +693,7 @@ err: if (b->type == TYPETEXT) { - if (ascii_strcasecmp("yes", mutt_get_parameter("x-mutt-noconv", b->parameter)) == 0) + if (mutt_strcasecmp("yes", mutt_get_parameter("x-mutt-noconv", b->parameter)) == 0) b->noconv = true; else { diff --git a/recvattach.c b/recvattach.c index 38532e0fd..29b45bbf6 100644 --- a/recvattach.c +++ b/recvattach.c @@ -122,7 +122,7 @@ struct AttachPtr **mutt_gen_attach_list(struct Body *m, int parent_type, } if (m->type == TYPEMULTIPART && m->parts && - (compose || (parent_type == -1 && (ascii_strcasecmp("alternative", m->subtype) != 0))) && + (compose || (parent_type == -1 && (mutt_strcasecmp("alternative", m->subtype) != 0))) && (!(WithCrypto & APPLICATION_PGP) || !mutt_is_multipart_encrypted(m))) { idx = mutt_gen_attach_list(m->parts, m->type, idx, idxlen, idxmax, level, compose); @@ -416,8 +416,8 @@ bool mutt_is_message_type(int type, const char *subtype) return false; subtype = NONULL(subtype); - return ((ascii_strcasecmp(subtype, "rfc822") == 0) || - (ascii_strcasecmp(subtype, "news") == 0)); + return ((mutt_strcasecmp(subtype, "rfc822") == 0) || + (mutt_strcasecmp(subtype, "news") == 0)); } static void prepend_curdir(char *dst, size_t dstlen) @@ -727,8 +727,8 @@ static int can_print(struct Body *top, int tag) { if (!rfc1524_mailcap_lookup(top, type, NULL, MUTT_PRINT)) { - if ((ascii_strcasecmp("text/plain", top->subtype) != 0) && - (ascii_strcasecmp("application/postscript", top->subtype) != 0)) + if ((mutt_strcasecmp("text/plain", top->subtype) != 0) && + (mutt_strcasecmp("application/postscript", top->subtype) != 0)) { if (!mutt_can_decode(top)) { @@ -757,8 +757,8 @@ static void print_attachment_list(FILE *fp, int tag, struct Body *top, struct St snprintf(type, sizeof(type), "%s/%s", TYPE(top), top->subtype); if (!option(OPT_ATTACH_SPLIT) && !rfc1524_mailcap_lookup(top, type, NULL, MUTT_PRINT)) { - if ((ascii_strcasecmp("text/plain", top->subtype) == 0) || - (ascii_strcasecmp("application/postscript", top->subtype) == 0)) + if ((mutt_strcasecmp("text/plain", top->subtype) == 0) || + (mutt_strcasecmp("application/postscript", top->subtype) == 0)) pipe_attachment(fp, top, state); else if (mutt_can_decode(top)) { @@ -913,7 +913,7 @@ static void attach_collapse(struct Body *b, short collapse, short init, short ju { i = init || b->collapsed; if (i && option(OPT_DIGEST_COLLAPSE) && b->type == TYPEMULTIPART && - (ascii_strcasecmp(b->subtype, "digest") == 0)) + (mutt_strcasecmp(b->subtype, "digest") == 0)) attach_collapse(b->parts, 1, 1, 0); else if (b->type == TYPEMULTIPART || mutt_is_message_type(b->type, b->subtype)) attach_collapse(b->parts, collapse, i, 0); diff --git a/remailer.c b/remailer.c index 0d45214ab..1da3ac253 100644 --- a/remailer.c +++ b/remailer.c @@ -423,7 +423,7 @@ static int mix_chain_add(struct MixChain *chain, const char *s, struct Remailer if (chain->cl >= MAXMIXES) return -1; - if ((mutt_strcmp(s, "0") == 0) || (ascii_strcasecmp(s, "") == 0)) + if ((mutt_strcmp(s, "0") == 0) || (mutt_strcasecmp(s, "") == 0)) { chain->ch[chain->cl++] = 0; return 0; @@ -431,7 +431,7 @@ static int mix_chain_add(struct MixChain *chain, const char *s, struct Remailer for (i = 0; type2_list[i]; i++) { - if (ascii_strcasecmp(s, type2_list[i]->shortname) == 0) + if (mutt_strcasecmp(s, type2_list[i]->shortname) == 0) { chain->ch[chain->cl++] = i; return 0; diff --git a/rfc1524.c b/rfc1524.c index 6a4eb8abf..778467cd2 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -217,8 +217,8 @@ static int rfc1524_mailcap_parse(struct Body *a, char *filename, char *type, /* check type */ ch = get_field(buf); - if ((ascii_strcasecmp(buf, type) != 0) && - ((ascii_strncasecmp(buf, type, btlen) != 0) || + if ((mutt_strcasecmp(buf, type) != 0) && + ((mutt_strncasecmp(buf, type, btlen) != 0) || (buf[btlen] != 0 && /* implicit wild */ (mutt_strcmp(buf + btlen, "/*") != 0)))) /* wildsubtype */ continue; @@ -242,51 +242,51 @@ static int rfc1524_mailcap_parse(struct Body *a, char *filename, char *type, ch = get_field(ch); mutt_debug(2, "field: %s\n", field); - if (ascii_strcasecmp(field, "needsterminal") == 0) + if (mutt_strcasecmp(field, "needsterminal") == 0) { if (entry) entry->needsterminal = true; } - else if (ascii_strcasecmp(field, "copiousoutput") == 0) + else if (mutt_strcasecmp(field, "copiousoutput") == 0) { copiousoutput = true; if (entry) entry->copiousoutput = true; } - else if (ascii_strncasecmp(field, "composetyped", 12) == 0) + else if (mutt_strncasecmp(field, "composetyped", 12) == 0) { /* this compare most occur before compose to match correctly */ if (get_field_text(field + 12, entry ? &entry->composetypecommand : NULL, type, filename, line)) composecommand = true; } - else if (ascii_strncasecmp(field, "compose", 7) == 0) + else if (mutt_strncasecmp(field, "compose", 7) == 0) { if (get_field_text(field + 7, entry ? &entry->composecommand : NULL, type, filename, line)) composecommand = true; } - else if (ascii_strncasecmp(field, "print", 5) == 0) + else if (mutt_strncasecmp(field, "print", 5) == 0) { if (get_field_text(field + 5, entry ? &entry->printcommand : NULL, type, filename, line)) printcommand = true; } - else if (ascii_strncasecmp(field, "edit", 4) == 0) + else if (mutt_strncasecmp(field, "edit", 4) == 0) { if (get_field_text(field + 4, entry ? &entry->editcommand : NULL, type, filename, line)) editcommand = true; } - else if (ascii_strncasecmp(field, "nametemplate", 12) == 0) + else if (mutt_strncasecmp(field, "nametemplate", 12) == 0) { get_field_text(field + 12, entry ? &entry->nametemplate : NULL, type, filename, line); } - else if (ascii_strncasecmp(field, "x-convert", 9) == 0) + else if (mutt_strncasecmp(field, "x-convert", 9) == 0) { get_field_text(field + 9, entry ? &entry->convert : NULL, type, filename, line); } - else if (ascii_strncasecmp(field, "test", 4) == 0) + else if (mutt_strncasecmp(field, "test", 4) == 0) { /* * This routine executes the given test command to determine diff --git a/rfc2047.c b/rfc2047.c index f9944f9fe..c662f9be1 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -317,7 +317,7 @@ static size_t try_block(ICONV_CONST char *d, size_t dlen, const char *fromcode, len_q = len + (ob - buf1) + 2 * count; /* Apparently RFC1468 says to use B encoding for iso-2022-jp. */ - if (ascii_strcasecmp(tocode, "ISO-2022-JP") == 0) + if (mutt_strcasecmp(tocode, "ISO-2022-JP") == 0) len_q = ENCWORD_LEN_MAX + 1; if (len_b < len_q && len_b <= ENCWORD_LEN_MAX) @@ -387,7 +387,7 @@ static size_t choose_block(char *d, size_t dlen, int col, const char *fromcode, const char *tocode, encoder_t *encoder, size_t *wlen) { size_t n, nn; - int utf8 = fromcode && (ascii_strcasecmp(fromcode, "utf-8") == 0); + int utf8 = fromcode && (mutt_strcasecmp(fromcode, "utf-8") == 0); n = dlen; for (;;) diff --git a/rfc3676.c b/rfc3676.c index 4504ba317..729107cb9 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -281,7 +281,7 @@ int rfc3676_handler(struct Body *a, struct State *s) /* respect DelSp of RfC3676 only with f=f parts */ if ((t = (char *) mutt_get_parameter("delsp", a->parameter))) { - delsp = mutt_strlen(t) == 3 && (ascii_strncasecmp(t, "yes", 3) == 0); + delsp = mutt_strlen(t) == 3 && (mutt_strncasecmp(t, "yes", 3) == 0); t = NULL; fst.delsp = 1; } diff --git a/rfc822.c b/rfc822.c index 5c228b502..0b767e1ad 100644 --- a/rfc822.c +++ b/rfc822.c @@ -87,7 +87,7 @@ int rfc822_remove_from_adrlist(struct Address **a, const char *mailbox) last = NULL; while (p) { - if (ascii_strcasecmp(mailbox, p->mailbox) == 0) + if (mutt_strcasecmp(mailbox, p->mailbox) == 0) { if (last) last->next = p->next; diff --git a/send.c b/send.c index fc41997f8..c310bc84e 100644 --- a/send.c +++ b/send.c @@ -96,7 +96,7 @@ static bool addrcmp(struct Address *a, struct Address *b) { if (!a->mailbox || !b->mailbox) return false; - if (ascii_strcasecmp(a->mailbox, b->mailbox) != 0) + if (mutt_strcasecmp(a->mailbox, b->mailbox) != 0) return false; return true; } @@ -311,7 +311,7 @@ static int edit_envelope(struct Envelope *en, int flags) buf[0] = 0; for (; uh; uh = uh->next) { - if (ascii_strncasecmp("subject:", uh->data, 8) == 0) + if (mutt_strncasecmp("subject:", uh->data, 8) == 0) { p = skip_email_wsp(uh->data + 8); strfcpy(buf, p, sizeof(buf)); @@ -344,18 +344,18 @@ static void process_user_recips(struct Envelope *env) for (; uh; uh = uh->next) { - if (ascii_strncasecmp("to:", uh->data, 3) == 0) + if (mutt_strncasecmp("to:", uh->data, 3) == 0) env->to = rfc822_parse_adrlist(env->to, uh->data + 3); - else if (ascii_strncasecmp("cc:", uh->data, 3) == 0) + else if (mutt_strncasecmp("cc:", uh->data, 3) == 0) env->cc = rfc822_parse_adrlist(env->cc, uh->data + 3); - else if (ascii_strncasecmp("bcc:", uh->data, 4) == 0) + else if (mutt_strncasecmp("bcc:", uh->data, 4) == 0) env->bcc = rfc822_parse_adrlist(env->bcc, uh->data + 4); #ifdef USE_NNTP - else if (ascii_strncasecmp("newsgroups:", uh->data, 11) == 0) + else if (mutt_strncasecmp("newsgroups:", uh->data, 11) == 0) env->newsgroups = nntp_get_header(uh->data + 11); - else if (ascii_strncasecmp("followup-to:", uh->data, 12) == 0) + else if (mutt_strncasecmp("followup-to:", uh->data, 12) == 0) env->followup_to = nntp_get_header(uh->data + 12); - else if (ascii_strncasecmp("x-comment-to:", uh->data, 13) == 0) + else if (mutt_strncasecmp("x-comment-to:", uh->data, 13) == 0) env->x_comment_to = nntp_get_header(uh->data + 13); #endif } @@ -372,18 +372,18 @@ static void process_user_header(struct Envelope *env) for (; uh; uh = uh->next) { - if (ascii_strncasecmp("from:", uh->data, 5) == 0) + if (mutt_strncasecmp("from:", uh->data, 5) == 0) { /* User has specified a default From: address. Remove default address */ rfc822_free_address(&env->from); env->from = rfc822_parse_adrlist(env->from, uh->data + 5); } - else if (ascii_strncasecmp("reply-to:", uh->data, 9) == 0) + else if (mutt_strncasecmp("reply-to:", uh->data, 9) == 0) { rfc822_free_address(&env->reply_to); env->reply_to = rfc822_parse_adrlist(env->reply_to, uh->data + 9); } - else if (ascii_strncasecmp("message-id:", uh->data, 11) == 0) + else if (mutt_strncasecmp("message-id:", uh->data, 11) == 0) { char *tmp = mutt_extract_message_id(uh->data + 11, NULL); if (rfc822_valid_msgid(tmp)) @@ -394,17 +394,17 @@ static void process_user_header(struct Envelope *env) else FREE(&tmp); } - else if ((ascii_strncasecmp("to:", uh->data, 3) != 0) && - (ascii_strncasecmp("cc:", uh->data, 3) != 0) && - (ascii_strncasecmp("bcc:", uh->data, 4) != 0) && + else if ((mutt_strncasecmp("to:", uh->data, 3) != 0) && + (mutt_strncasecmp("cc:", uh->data, 3) != 0) && + (mutt_strncasecmp("bcc:", uh->data, 4) != 0) && #ifdef USE_NNTP - (ascii_strncasecmp("newsgroups:", uh->data, 11) != 0) && - (ascii_strncasecmp("followup-to:", uh->data, 12) != 0) && - (ascii_strncasecmp("x-comment-to:", uh->data, 13) != 0) && + (mutt_strncasecmp("newsgroups:", uh->data, 11) != 0) && + (mutt_strncasecmp("followup-to:", uh->data, 12) != 0) && + (mutt_strncasecmp("x-comment-to:", uh->data, 13) != 0) && #endif - (ascii_strncasecmp("supersedes:", uh->data, 11) != 0) && - (ascii_strncasecmp("subject:", uh->data, 8) != 0) && - (ascii_strncasecmp("return-path:", uh->data, 12) != 0)) + (mutt_strncasecmp("supersedes:", uh->data, 11) != 0) && + (mutt_strncasecmp("subject:", uh->data, 8) != 0) && + (mutt_strncasecmp("return-path:", uh->data, 12) != 0)) { if (last) { @@ -1605,7 +1605,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, if (!(flags & SENDKEY)) { if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT && - (ascii_strcasecmp(msg->content->subtype, "plain") == 0)) + (mutt_strcasecmp(msg->content->subtype, "plain") == 0)) mutt_set_parameter("format", "flowed", &msg->content->parameter); } @@ -1711,10 +1711,10 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, * parameter will be present. */ if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT && - (ascii_strcasecmp("plain", msg->content->subtype) == 0)) + (mutt_strcasecmp("plain", msg->content->subtype) == 0)) { char *p = mutt_get_parameter("format", msg->content->parameter); - if (ascii_strcasecmp("flowed", NONULL(p)) != 0) + if (mutt_strcasecmp("flowed", NONULL(p)) != 0) rfc3676_space_stuff(msg); } diff --git a/sendlib.c b/sendlib.c index fda68c7b6..cd3ed9fa6 100644 --- a/sendlib.c +++ b/sendlib.c @@ -347,7 +347,7 @@ int mutt_write_mime_header(struct Body *a, FILE *f) * even when they aren't needed. */ - if ((ascii_strcasecmp(p->attribute, "boundary") == 0) && (strcmp(buffer, tmp) == 0)) + if ((mutt_strcasecmp(p->attribute, "boundary") == 0) && (strcmp(buffer, tmp) == 0)) snprintf(buffer, sizeof(buffer), "\"%s\"", tmp); FREE(&tmp); @@ -697,7 +697,7 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes, infos = safe_calloc(ncodes, sizeof(struct Content)); for (i = 0; i < ncodes; i++) - if (ascii_strcasecmp(tocodes[i], "utf-8") != 0) + if (mutt_strcasecmp(tocodes[i], "utf-8") != 0) cd[i] = mutt_iconv_open(tocodes[i], "utf-8", 0); else { @@ -1052,7 +1052,7 @@ int mutt_lookup_mime_type(struct Body *att, const char *path) sze = mutt_strlen(p); if ((sze > cur_sze) && (szf >= sze) && ((mutt_strcasecmp(path + szf - sze, p) == 0) || - (ascii_strcasecmp(path + szf - sze, p) == 0)) && + (mutt_strcasecmp(path + szf - sze, p) == 0)) && (szf == sze || path[szf - sze - 1] == '.')) { /* get the content-type */ @@ -1239,7 +1239,7 @@ static void set_encoding(struct Body *b, struct Content *info) if (b->type == TYPETEXT) { char *chsname = mutt_get_body_charset(send_charset, sizeof(send_charset), b); - if ((info->lobin && (ascii_strncasecmp(chsname, "iso-2022", 8) != 0)) || + if ((info->lobin && (mutt_strncasecmp(chsname, "iso-2022", 8) != 0)) || info->linemax > 990 || (info->from && option(OPT_ENCODE_FROM))) b->encoding = ENCQUOTEDPRINTABLE; else if (info->hibin) @@ -1260,7 +1260,7 @@ static void set_encoding(struct Body *b, struct Content *info) b->encoding = ENC7BIT; } else if (b->type == TYPEAPPLICATION && - (ascii_strcasecmp(b->subtype, "pgp-keys") == 0)) + (mutt_strcasecmp(b->subtype, "pgp-keys") == 0)) b->encoding = ENC7BIT; else { @@ -1838,7 +1838,7 @@ static int write_one_header(FILE *fp, int pfxw, int max, int wraplen, const char const char *start, const char *end, int flags) { char *tagbuf = NULL, *valbuf = NULL, *t = NULL; - int is_from = ((end - start) > 5 && (ascii_strncasecmp(start, "from ", 5) == 0)); + int is_from = ((end - start) > 5 && (mutt_strncasecmp(start, "from ", 5) == 0)); /* only pass through folding machinery if necessary for sending, never wrap From_ headers on sending */ @@ -2154,7 +2154,7 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env, } /* check to see if the user has overridden the user-agent field */ - if (ascii_strncasecmp("user-agent", tmp->data, 10) == 0) + if (mutt_strncasecmp("user-agent", tmp->data, 10) == 0) { has_agent = true; if (privacy) @@ -2827,7 +2827,7 @@ struct Address *mutt_remove_duplicates(struct Address *addr) for (tmp = top, dup = false; tmp && tmp != addr; tmp = tmp->next) { if (tmp->mailbox && addr->mailbox && - (ascii_strcasecmp(addr->mailbox, tmp->mailbox) == 0)) + (mutt_strcasecmp(addr->mailbox, tmp->mailbox) == 0)) { dup = true; break; diff --git a/smtp.c b/smtp.c index b10e5a40f..99282f625 100644 --- a/smtp.c +++ b/smtp.c @@ -120,19 +120,19 @@ static int smtp_get_resp(struct Connection *conn) return SMTP_ERR_READ; } - if (ascii_strncasecmp("8BITMIME", buf + 4, 8) == 0) + if (mutt_strncasecmp("8BITMIME", buf + 4, 8) == 0) mutt_bit_set(Capabilities, EIGHTBITMIME); - else if (ascii_strncasecmp("AUTH ", buf + 4, 5) == 0) + else if (mutt_strncasecmp("AUTH ", buf + 4, 5) == 0) { mutt_bit_set(Capabilities, AUTH); FREE(&AuthMechs); AuthMechs = safe_strdup(buf + 9); } - else if (ascii_strncasecmp("DSN", buf + 4, 3) == 0) + else if (mutt_strncasecmp("DSN", buf + 4, 3) == 0) mutt_bit_set(Capabilities, DSN); - else if (ascii_strncasecmp("STARTTLS", buf + 4, 8) == 0) + else if (mutt_strncasecmp("STARTTLS", buf + 4, 8) == 0) mutt_bit_set(Capabilities, STARTTLS); - else if (ascii_strncasecmp("SMTPUTF8", buf + 4, 8) == 0) + else if (mutt_strncasecmp("SMTPUTF8", buf + 4, 8) == 0) mutt_bit_set(Capabilities, SMTPUTF8); if (!valid_smtp_code(buf, n, &n)) @@ -533,7 +533,7 @@ static int smtp_auth_plain(struct Connection *conn) for (method = delim = SmtpAuthenticators; *delim && (delim = mutt_strchrnul(method, ':')); method = delim + 1) { - if (ascii_strncasecmp(method, "plain", 5) == 0) + if (mutt_strncasecmp(method, "plain", 5) == 0) { /* Get username and password. Bail out of any cannot be retrieved. */ if (mutt_account_getuser(&conn->account) || mutt_account_getpass(&conn->account)) diff --git a/url.c b/url.c index 5d827c63d..8577ec51c 100644 --- a/url.c +++ b/url.c @@ -317,7 +317,7 @@ int url_parse_mailto(struct Envelope *e, char **body, const char *src) */ if (mutt_matches_list(tag, MailToAllow)) { - if (ascii_strcasecmp(tag, "body") == 0) + if (mutt_strcasecmp(tag, "body") == 0) { if (body) mutt_str_replace(body, value); -- 2.40.0