counterparts.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
ALIAS *t = Aliases;
for (; t; t = t->next)
- if (!str_casecmp (s, t->name))
+ if (!m_strcasecmp(s, t->name))
return (t->addr);
return (NULL); /* no such alias */
}
{
ALIAS *pa = *(ALIAS **) a;
ALIAS *pb = *(ALIAS **) b;
- int r = str_casecmp (pa->name, pb->name);
+ int r = m_strcasecmp(pa->name, pb->name);
return (RSORT (r));
}
r = 1;
else if (pa->personal) {
if (pb->personal)
- r = str_casecmp (pa->personal, pb->personal);
+ r = m_strcasecmp(pa->personal, pb->personal);
else
r = 1;
}
}
else {
lng = m_strlen(p);
- if (buf[lng] == '/' && str_ncasecmp (buf, p, lng) == 0)
+ if (buf[lng] == '/' && m_strncasecmp(buf, p, lng) == 0)
return (1);
}
struct folder_file *pa = (struct folder_file *) a;
struct folder_file *pb = (struct folder_file *) b;
- int r = str_coll (pa->name, pb->name);
+ int r = strcoll(NONULL(pa->name), NONULL(pb->name));
return ((BrowserSort & SORT_REVERSE) ? -r : r);
}
continue; /* we don't need . */
if (prefix && *prefix
- && str_ncmp (prefix, de->d_name, m_strlen(prefix)) != 0)
+ && m_strncmp(prefix, de->d_name, m_strlen(prefix)) != 0)
continue;
if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
continue;
if (bytes_read == -1)
return -1;
for (i = bytes_read; --i >= 0;)
- if (!str_ncmp (buffer + i, "\n\nFrom ", m_strlen("\n\nFrom "))) { /* found it - go to the beginning of the From */
+ if (!m_strncmp(buffer + i, "\n\nFrom ", m_strlen("\n\nFrom "))) { /* found it - go to the beginning of the From */
fseeko (f, pos + i + 2, SEEK_SET);
return 0;
}
}
/* here we are at the beginning of the file */
- if (!str_ncmp ("From ", buffer, 5)) {
+ if (!m_strncmp("From ", buffer, 5)) {
fseeko (f, 0, 0);
return (0);
}
for (i = 0; PreferredMIMENames[i].key; i++)
if (!ascii_strcasecmp (scratch, PreferredMIMENames[i].key) ||
- !str_casecmp (scratch, PreferredMIMENames[i].key)) {
+ !m_strcasecmp(scratch, PreferredMIMENames[i].key)) {
strfcpy (dest, PreferredMIMENames[i].pref, dlen);
return;
}
{
char *eptr;
- if (str_ncasecmp (s, "bright", 6) == 0) {
+ if (m_strncasecmp(s, "bright", 6) == 0) {
*attr |= brite;
s += 6;
}
/* allow aliases for xterm color resources */
- if (str_ncasecmp (s, "color", 5) == 0) {
+ if (m_strncasecmp(s, "color", 5) == 0) {
s += 5;
*col = strtol (s, &eptr, 10);
if (!*s || *eptr || *col < 0 ||
return (-1);
}
- if (str_ncmp (buf->data, "index", 5) != 0) {
+ if (m_strncmp(buf->data, "index", 5) != 0) {
snprintf (err->data, err->dsize,
_("%s: command valid only for index object"),
parse_uncolor ? "uncolor" : "unmono");
break;
}
else {
- if (str_casecmp (s, tmp->pattern) == 0)
+ if (m_strcasecmp(s, tmp->pattern) == 0)
break;
}
tmp = tmp->next;
}
mutt_extract_token (buf, s, 0);
- if (!str_ncmp (buf->data, "quoted", 6)) {
+ if (!m_strncmp(buf->data, "quoted", 6)) {
if (buf->data[6]) {
*ql = strtol (buf->data + 6, &eptr, 10);
if (*eptr || q_level < 0) {
NNTP_DATA *data = (NNTP_DATA *) l->data;
if (data && data->subscribed &&
- str_ncmp (data->group, filepart, len) == 0) {
+ m_strncmp(data->group, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && data->group[i]; i++) {
if (filepart[i] != data->group[i]) {
}
while ((de = readdir (dirp)) != NULL) {
- if (str_ncmp (de->d_name, filepart, len) == 0) {
+ if (m_strncmp(de->d_name, filepart, len) == 0) {
if (init) {
for (i = 0; filepart[i] && de->d_name[i]; i++) {
if (filepart[i] != de->d_name[i]) {
/* Is it the begining of a header? */
if (nl && buf[0] != ' ' && buf[0] != '\t') {
ignore = 1;
- if (!from && str_ncmp ("From ", buf, 5) == 0) {
+ if (!from && m_strncmp("From ", buf, 5) == 0) {
if ((flags & CH_FROM) == 0)
continue;
from = 1;
ignore = 1;
this_is_from = 0;
- if (!from && str_ncmp ("From ", buf, 5) == 0) {
+ if (!from && m_strncmp("From ", buf, 5) == 0) {
if ((flags & CH_FROM) == 0)
continue;
this_is_from = from = 1;
rv |= CRYPT_KV_STRONGID;
if (addr->mailbox && u_addr->mailbox
- && str_casecmp (addr->mailbox, u_addr->mailbox) == 0)
+ && m_strcasecmp(addr->mailbox, u_addr->mailbox) == 0)
rv |= CRYPT_KV_ADDR;
if (addr->personal && u_addr->personal
- && str_casecmp (addr->personal, u_addr->personal) == 0)
+ && m_strcasecmp(addr->personal, u_addr->personal) == 0)
rv |= CRYPT_KV_STRING;
return rv;
}
while (fgets (buf, sizeof (buf), tfp)) {
- if (!str_ncmp ("-----BEGIN PGP ", buf, 15)) {
+ if (!m_strncmp("-----BEGIN PGP ", buf, 15)) {
if (!m_strcmp("MESSAGE-----\n", buf + 15))
enc = 1;
else if (!m_strcmp("SIGNED MESSAGE-----\n", buf + 15))
bytes -= (offset - last_pos); /* don't rely on m_strlen(buf) */
last_pos = offset;
- if (!str_ncmp ("-----BEGIN PGP ", buf, 15)) {
+ if (!m_strncmp("-----BEGIN PGP ", buf, 15)) {
clearsign = 0;
start_pos = last_pos;
crypt_key_t **t = (crypt_key_t **) b;
int r;
- if ((r = str_casecmp ((*s)->uid, (*t)->uid)))
+ if ((r = m_strcasecmp((*s)->uid, (*t)->uid)))
return r > 0;
else
- return str_casecmp (crypt_keyid (*s), crypt_keyid (*t)) > 0;
+ return m_strcasecmp(crypt_keyid (*s), crypt_keyid (*t)) > 0;
}
static int crypt_compare_address (const void *a, const void *b)
crypt_key_t **t = (crypt_key_t **) b;
int r;
- if ((r = str_casecmp (crypt_keyid (*s), crypt_keyid (*t))))
+ if ((r = m_strcasecmp(crypt_keyid (*s), crypt_keyid (*t))))
return r > 0;
else
- return str_casecmp ((*s)->uid, (*t)->uid) > 0;
+ return m_strcasecmp((*s)->uid, (*t)->uid) > 0;
}
static int crypt_compare_keyid (const void *a, const void *b)
if (ts < tt)
return 0;
- return str_casecmp ((*s)->uid, (*t)->uid) > 0;
+ return m_strcasecmp((*s)->uid, (*t)->uid) > 0;
}
static int crypt_compare_date (const void *a, const void *b)
if (ts < tt)
return 0;
- if ((r = str_casecmp ((*s)->uid, (*t)->uid)))
+ if ((r = m_strcasecmp((*s)->uid, (*t)->uid)))
return r > 0;
- return (str_casecmp (crypt_keyid ((*s)), crypt_keyid ((*t)))) > 0;
+ return (m_strcasecmp(crypt_keyid ((*s)), crypt_keyid ((*t)))) > 0;
}
static int crypt_compare_trust (const void *a, const void *b)
match = 0;
debug_print (5, ("matching \"%s\" against " "key %s, \"%s\":\n", p, crypt_keyid (k), k->uid));
- if (!*p || !str_casecmp (p, crypt_keyid (k))
- || (!str_ncasecmp (p, "0x", 2)
- && !str_casecmp (p + 2, crypt_keyid (k)))
+ if (!*p || !m_strcasecmp(p, crypt_keyid (k))
+ || (!m_strncasecmp(p, "0x", 2)
+ && !m_strcasecmp(p + 2, crypt_keyid (k)))
|| (option (OPTPGPLONGIDS)
- && !str_ncasecmp (p, "0x", 2)
- && !str_casecmp (p + 2, crypt_keyid (k) + 8))
+ && !m_strncasecmp(p, "0x", 2)
+ && !m_strcasecmp(p + 2, crypt_keyid (k) + 8))
|| str_isstr (k->uid, p)) {
crypt_key_t *tmp;
if (whatfor) {
for (l = id_defaults; l; l = l->next)
- if (!str_casecmp (whatfor, l->what)) {
+ if (!m_strcasecmp(whatfor, l->what)) {
strfcpy (resp, NONULL (l->dflt), sizeof (resp));
break;
}
convert_to_7bit (a->parts);
}
else if (a->type == TYPEMESSAGE &&
- str_casecmp (a->subtype, "delivery-status")) {
+ m_strcasecmp(a->subtype, "delivery-status")) {
if (a->encoding != ENC7BIT)
mutt_message_to_7bit (a, NULL);
}
/* consistency check */
if (!(a && a->next && a->next->type == protocol_major &&
- !str_casecmp (a->next->subtype, protocol_minor))) {
+ !m_strcasecmp(a->next->subtype, protocol_minor))) {
state_attach_puts (_("[-- Error: "
"Inconsistent multipart/signed structure! --]\n\n"),
s);
if ((WithCrypto & APPLICATION_PGP)
&& protocol_major == TYPEAPPLICATION
- && !str_casecmp (protocol_minor, "pgp-signature"));
+ && !m_strcasecmp(protocol_minor, "pgp-signature"));
else if ((WithCrypto & APPLICATION_SMIME)
&& protocol_major == TYPEAPPLICATION
- && !(str_casecmp (protocol_minor, "x-pkcs7-signature")
- && str_casecmp (protocol_minor, "pkcs7-signature")));
+ && !(m_strcasecmp(protocol_minor, "x-pkcs7-signature")
+ && m_strcasecmp(protocol_minor, "pkcs7-signature")));
else if (protocol_major == TYPEMULTIPART
- && !str_casecmp (protocol_minor, "mixed"));
+ && !m_strcasecmp(protocol_minor, "mixed"));
else {
state_printf (s, _("[-- Error: "
"Unknown multipart/signed protocol %s! --]\n\n"),
for (i = 0; i < sigcnt; i++) {
if ((WithCrypto & APPLICATION_PGP)
&& signatures[i]->type == TYPEAPPLICATION
- && !str_casecmp (signatures[i]->subtype, "pgp-signature")) {
+ && !m_strcasecmp(signatures[i]->subtype, "pgp-signature")) {
if (crypt_pgp_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;
if ((WithCrypto & APPLICATION_SMIME)
&& signatures[i]->type == TYPEAPPLICATION
&&
- (!str_casecmp (signatures[i]->subtype, "x-pkcs7-signature")
- || !str_casecmp (signatures[i]->subtype,
+ (!m_strcasecmp(signatures[i]->subtype, "x-pkcs7-signature")
+ || !m_strcasecmp(signatures[i]->subtype,
"pkcs7-signature"))) {
if (crypt_smime_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;
sleep (2);
}
else if (op != OP_FOLLOWUP || !CURHDR->env->followup_to ||
- str_casecmp (CURHDR->env->followup_to, "poster") ||
+ m_strcasecmp(CURHDR->env->followup_to, "poster") ||
query_quadoption (OPT_FOLLOWUPTOPOSTER,
_("Reply by mail as poster prefers?")) !=
M_YES) {
int i;
for (i = 0; i < 12; i++)
- if (str_ncasecmp (s, Months[i], 3) == 0)
+ if (m_strncasecmp(s, Months[i], 3) == 0)
return (i);
return (-1); /* error */
}
if ((m_strlen(s) < 3) || !*(s + 3) || !ISSPACE (*(s + 3)))
return 0;
for (i = 0; i < 7; i++)
- if (str_ncasecmp (s, Weekdays[i], 3) == 0)
+ if (m_strncasecmp(s, Weekdays[i], 3) == 0)
return 1;
return 0;
}
if (path)
*path = 0;
- if (str_ncmp ("From ", s, 5) != 0)
+ if (m_strncmp("From ", s, 5) != 0)
return 0;
s = next_word (s); /* skip over the From part. */
p = tmp;
while (ISSPACE (*p))
p++;
- if (str_ncmp ("domain", p, 6) == 0
- || str_ncmp ("search", p, 6) == 0) {
+ if (m_strncmp("domain", p, 6) == 0 || m_strncmp("search", p, 6) == 0) {
p += 6;
for (q = strtok (p, " \t\n"); q; q = strtok (NULL, " \t\n"))
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
len -= m_strlen(tmps);
- if ((!str_ncmp (tmps, "begin", 5)) && ISSPACE (tmps[5]))
+ if ((!m_strncmp(tmps, "begin", 5)) && ISSPACE (tmps[5]))
break;
}
while (len > 0) {
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
len -= m_strlen(tmps);
- if (!str_ncmp (tmps, "end", 3))
+ if (!m_strncmp(tmps, "end", 3))
break;
pt = tmps;
linelen = decode_byte (*pt);
handler = mutt_signed_handler;
}
else if ((WithCrypto & APPLICATION_PGP)
- && str_casecmp ("encrypted", b->subtype) == 0) {
+ && m_strcasecmp("encrypted", b->subtype) == 0) {
p = mutt_get_parameter ("protocol", b->parameter);
if (!p)
&& (hdr->thread->parent && hdr->thread->parent->message
&& hdr->thread->parent->message->env->x_label))
htmp = hdr->thread->parent->message;
- if (htmp && str_casecmp (hdr->env->x_label,
+ if (htmp && m_strcasecmp(hdr->env->x_label,
htmp->env->x_label) == 0)
i = 0;
}
if (isparent)
noselect = 1;
/* prune current folder from output */
- if (isparent || str_ncmp (name, mx.mbox, m_strlen(name)))
+ if (isparent || m_strncmp(name, mx.mbox, m_strlen(name)))
imap_add_folder (idata->delim, name, noselect, noinferiors, state,
isparent);
}
if (isparent)
strfcpy (relpath, "../", sizeof (relpath));
/* strip current folder from target, to render a relative path */
- else if (!str_ncmp (mx.mbox, folder, m_strlen(mx.mbox)))
+ else if (!m_strncmp(mx.mbox, folder, m_strlen(mx.mbox)))
strfcpy (relpath, folder + m_strlen(mx.mbox), sizeof (relpath));
else
strfcpy (relpath, folder, sizeof (relpath));
if (m_strcmp(mbox_unquoted, idata->mailbox) == 0
|| (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
- && str_casecmp (mbox_unquoted, idata->mailbox) == 0)) {
+ && m_strcasecmp(mbox_unquoted, idata->mailbox) == 0)) {
strfcpy (buf, "NOOP", sizeof (buf));
}
else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) ||
/* The mailbox name may or may not be quoted here. We could try to
* munge the server response and compare with quoted (or vise versa)
* but it is probably more efficient to just strncmp against both. */
- if (str_ncmp (mbox_unquoted, s, m_strlen(mbox_unquoted)) == 0
- || str_ncmp (mbox, s, m_strlen(mbox)) == 0) {
+ if (m_strncmp(mbox_unquoted, s, m_strlen(mbox_unquoted)) == 0
+ || m_strncmp(mbox, s, m_strlen(mbox)) == 0) {
s = imap_next_word (s);
s = imap_next_word (s);
if (isdigit ((unsigned char) *s)) {
return (-1);
for (i = 0; i < Incoming->length; i++) {
mailbox = (BUFFY*) Incoming->data[i];
- if (!str_ncmp (dest, mailbox->path, matchlen)) {
+ if (!m_strncmp(dest, mailbox->path, matchlen)) {
if (rc) {
strfcpy (dest, mailbox->path, len);
rc = 0;
url.user = NULL;
url.path = NULL;
url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0);
- if (!str_ncmp (dest, urlstr, matchlen)) {
+ if (!m_strncmp(dest, urlstr, matchlen)) {
if (rc) {
strfcpy (dest, urlstr, len);
rc = 0;
if (mx_get_magic (Maildir) == M_IMAP && !imap_parse_path (Maildir, &home)) {
hlen = m_strlen(home.mbox);
if (tlen && mutt_account_match (&home.account, &target.account) &&
- !str_ncmp (home.mbox, target.mbox, hlen)) {
+ !m_strncmp(home.mbox, target.mbox, hlen)) {
if (!hlen)
home_match = 1;
else
* if name starts with $folder, just strip it to keep hierarchy
* $folder=imap://host, path=imap://host/inbox/b -> inbox/b
*/
- if (Maildirlength > 0 && str_ncmp (CurrentFolder, Maildir,
+ if (Maildirlength > 0 && m_strncmp(CurrentFolder, Maildir,
Maildirlength) == 0 &&
m_strlen(CurrentFolder) > Maildirlength) {
val = CurrentFolder + Maildirlength;
a = p_new(ATTACH_MATCH, 1);
/* some cheap hacks that I expect to remove */
- if (!str_casecmp(buf->data, "any"))
+ if (!m_strcasecmp(buf->data, "any"))
a->major = m_strdup("*/.*");
- else if (!str_casecmp(buf->data, "none"))
+ else if (!m_strcasecmp(buf->data, "none"))
a->major = m_strdup("cheap_hack/this_should_never_match");
else
a->major = m_strdup(buf->data);
do {
mutt_extract_token (buf, s, 0);
- if (!str_casecmp(buf->data, "any"))
+ if (!m_strcasecmp(buf->data, "any"))
tmp = m_strdup("*/.*");
- else if (!str_casecmp(buf->data, "none"))
+ else if (!m_strcasecmp(buf->data, "none"))
tmp = m_strdup("cheap_hack/this_should_never_match");
else
tmp = m_strdup(buf->data);
a = (ATTACH_MATCH *)lp->data;
debug_print(5, ("parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n",
a->major, a->minor, a->major_int, tmp, minor, major));
- if (a->major_int == major && !str_casecmp(minor, a->minor)) {
+ if (a->major_int == major && !m_strcasecmp(minor, a->minor)) {
debug_print(5, ("parse_unattach_list: removed %s/%s [%d]\n",
a->major, a->minor, a->major_int));
regfree(&a->minor_rx);
op = '+';
category--;
}
- if (!str_ncasecmp(category, "attachment", strlen(category))) {
+ if (!m_strncasecmp(category, "attachment", strlen(category))) {
if (op == '+')
listp = &AttachAllow;
else
listp = &AttachExclude;
}
- else if (!str_ncasecmp(category, "inline", strlen(category))) {
+ else if (!m_strncasecmp(category, "inline", strlen(category))) {
if (op == '+')
listp = &InlineAllow;
else
op = '+';
p--;
}
- if (!str_ncasecmp(p, "attachment", strlen(p))) {
+ if (!m_strncasecmp(p, "attachment", strlen(p))) {
if (op == '+')
listp = &AttachAllow;
else
listp = &AttachExclude;
}
- else if (!str_ncasecmp(p, "inline", strlen(p))) {
+ else if (!m_strncasecmp(p, "inline", strlen(p))) {
if (op == '+')
listp = &InlineAllow;
else
}
else
for (tmp = Aliases; tmp; tmp = tmp->next) {
- if (str_casecmp (buf->data, tmp->name) == 0) {
+ if (m_strcasecmp(buf->data, tmp->name) == 0) {
if (CurrentMenu == MENU_ALIAS) {
tmp->del = 1;
set_option (OPTFORCEREDRAWINDEX);
/* check to see if an alias with this name already exists */
for (; tmp; tmp = tmp->next) {
- if (!str_casecmp (tmp->name, buf->data))
+ if (!m_strcasecmp(tmp->name, buf->data))
break;
last = tmp;
}
char* errbuf, size_t errlen) {
int i, flags = 0;
- if (str_ncmp ("reverse-", s, 8) == 0) {
+ if (m_strncmp("reverse-", s, 8) == 0) {
s += 8;
flags = SORT_REVERSE;
}
- if (str_ncmp ("last-", s, 5) == 0) {
+ if (m_strncmp("last-", s, 5) == 0) {
s += 5;
flags |= SORT_LAST;
}
static int check_dsn_return (const char* option, unsigned long p,
char* errbuf, size_t errlen) {
char* val = (char*) p;
- if (val && *val && str_ncmp (val, "hdrs", 4) != 0 &&
- str_ncmp (val, "full", 4) != 0) {
+ if (val && *val && m_strncmp(val, "hdrs", 4) != 0 &&
+ m_strncmp(val, "full", 4) != 0) {
if (errbuf)
snprintf (errbuf, errlen, _("'%s' is invalid for $%s"), val, "dsn_return");
return (0);
return (1);
for (i = 0; i < list->length; i++)
- if (str_ncmp (list->data[i], "never", 5) != 0 &&
- str_ncmp (list->data[i], "failure", 7) != 0 &&
- str_ncmp (list->data[i], "delay", 5) != 0 &&
- str_ncmp (list->data[i], "success", 7) != 0) {
+ if (m_strncmp(list->data[i], "never", 5) != 0 &&
+ m_strncmp(list->data[i], "failure", 7) != 0 &&
+ m_strncmp(list->data[i], "delay", 5) != 0 &&
+ m_strncmp(list->data[i], "success", 7) != 0) {
if (errbuf)
snprintf (errbuf, errlen, _("'%s' is invalid for $%s"),
(char*) list->data[i], "dsn_notify");
query = 1;
s->dptr++;
}
- else if (str_ncmp ("no", s->dptr, 2) == 0) {
+ else if (m_strncmp("no", s->dptr, 2) == 0) {
s->dptr += 2;
unset = !unset;
}
- else if (str_ncmp ("inv", s->dptr, 3) == 0) {
+ else if (m_strncmp("inv", s->dptr, 3) == 0) {
s->dptr += 3;
inv = !inv;
}
/* return the completed command */
m_strcpy(buffer, len - spaces, Completed);
}
- else if (!str_ncmp (buffer, "set", 3)
- || !str_ncmp (buffer, "unset", 5)
- || !str_ncmp (buffer, "reset", 5)
- || !str_ncmp (buffer, "toggle", 6)) { /* complete variables */
+ else if (!m_strncmp(buffer, "set", 3)
+ || !m_strncmp(buffer, "unset", 5)
+ || !m_strncmp(buffer, "reset", 5)
+ || !m_strncmp(buffer, "toggle", 6)) { /* complete variables */
const char *prefixes[] = { "no", "inv", "?", "&", NULL };
pt++;
/* loop through all the possible prefixes (no, inv, ...) */
- if (!str_ncmp (buffer, "set", 3)) {
+ if (!m_strncmp(buffer, "set", 3)) {
for (num = 0; prefixes[num]; num++) {
- if (!str_ncmp (pt, prefixes[num], m_strlen(prefixes[num]))) {
+ if (!m_strncmp(pt, prefixes[num], m_strlen(prefixes[num]))) {
pt += m_strlen(prefixes[num]);
break;
}
m_strcpy(pt, buffer + len - pt - spaces, Completed);
}
- else if (!str_ncmp (buffer, "exec", 4)) {
+ else if (!m_strncmp(buffer, "exec", 4)) {
struct binding_t *menu = km_get_table (CurrentMenu);
if (!menu && CurrentMenu != MENU_PAGER)
if (*pt == '=') /* abort if no var before the '=' */
return 0;
- if (str_ncmp (buffer, "set", 3) == 0) {
+ if (m_strncmp(buffer, "set", 3) == 0) {
strfcpy (var, pt, sizeof(var));
/* ignore the trailing '=' when comparing */
var[m_strlen(var) - 1] = 0;
int ascii_strncasecmp(const char *a, const char *b, int n);
#define ascii_strcmp(a,b) m_strcmp(a,b)
-#define ascii_strncmp(a,b,c) str_ncmp(a,b,c)
+#define ascii_strncmp(a,b,c) m_strncmp(a,b,c)
#endif /* MUTT_LIB_LIB_ASCII_H */
return strcmp(NONULL(a), NONULL(b));
}
+static inline int m_strcasecmp(const char *a, const char *b) {
+ return strcasecmp(NONULL(a), NONULL(b));
+}
+
+static inline int m_strncmp(const char *a, const char *b, size_t n) {
+ return strncmp (NONULL(a), NONULL(b), n);
+}
+
+static inline int m_strncasecmp(const char *a, const char *b, size_t n) {
+ return strncasecmp(NONULL(a), NONULL(b), n);
+}
+
ssize_t m_strcpy(char *dst, ssize_t n, const char *src);
ssize_t m_strncpy(char *dst, ssize_t n, const char *src, ssize_t l);
#include "str.h"
-int str_casecmp (const char *a, const char *b)
-{
- return strcasecmp (NONULL (a), NONULL (b));
-}
-
-int str_ncmp (const char *a, const char *b, size_t l)
-{
- return strncmp (NONULL (a), NONULL (b), l);
-}
-
-int str_ncasecmp (const char *a, const char *b, size_t l)
-{
- return strncasecmp (NONULL (a), NONULL (b), l);
-}
-
-int str_coll (const char *a, const char *b)
-{
- return strcoll (NONULL (a), NONULL (b));
-}
-
void str_replace (char **p, const char *s)
{
p_delete(p);
if (l != m_strlen(s2))
return (0);
- return (str_ncmp (s1, s2, l) == 0);
+ return (m_strncmp(s1, s2, l) == 0);
}
char* str_skip_initws (char* s) {
* unreliable behavior on some systems */
# define SKIPWS(c) while (*(c) && isspace ((unsigned char) *(c))) c++;
-/*
- * safety wrappers/replacements
- * (mostly only difference: safely handle NULL strings)
- */
-int str_casecmp (const char*, const char*);
-int str_ncmp (const char*, const char*, size_t);
-int str_ncasecmp (const char*, const char*, size_t);
-int str_coll (const char*, const char*);
-
/*
* tools
*/
*/
if (fseeko (ctx->fp, tmploc, SEEK_SET) != 0 ||
fgets (buf, sizeof (buf), ctx->fp) == NULL ||
- str_ncmp ("From ", buf, 5) != 0) {
+ m_strncmp("From ", buf, 5) != 0) {
debug_print (1, ("bad content-length in message %d (cl=%zd)\n",
curhdr->index, curhdr->content->length));
debug_print (1, ("LINE: %s\n", buf));
if (fseeko (ctx->fp, ctx->size, SEEK_SET) != 0)
debug_print (1, ("fseeko() failed\n"));
if (fgets (buffer, sizeof (buffer), ctx->fp) != NULL) {
- if ((ctx->magic == M_MBOX && str_ncmp ("From ", buffer, 5) == 0)
+ if ((ctx->magic == M_MBOX && m_strncmp("From ", buffer, 5) == 0)
|| (ctx->magic == M_MMDF && m_strcmp(MMDF_SEP, buffer) == 0)) {
if (fseeko (ctx->fp, ctx->size, SEEK_SET) != 0)
debug_print (1, ("fseeko() failed\n"));
if (fseeko (ctx->fp, offset, SEEK_SET) != 0 || /* seek the append location */
/* do a sanity check to make sure the mailbox looks ok */
fgets (buf, sizeof (buf), ctx->fp) == NULL ||
- (ctx->magic == M_MBOX && str_ncmp ("From ", buf, 5) != 0) ||
+ (ctx->magic == M_MBOX && m_strncmp("From ", buf, 5) != 0) ||
(ctx->magic == M_MMDF && m_strcmp(MMDF_SEP, buf) != 0)) {
debug_print (1, ("message not in expected position.\n"));
debug_print (1, ("LINE: %s\n", buf));
struct utimbuf times;
#endif
fgets (tmp, sizeof (tmp), f);
- if (str_ncmp ("From ", tmp, 5) == 0)
+ if (m_strncmp("From ", tmp, 5) == 0)
magic = M_MBOX;
else if (m_strcmp(MMDF_SEP, tmp) == 0)
magic = M_MMDF;
/* first, copy unknown sequences */
if ((ofp = fopen (sequences, "r"))) {
while ((buff = mutt_read_line (buff, &s, ofp, &l))) {
- if (!str_ncmp (buff, seq_unseen, m_strlen(seq_unseen)))
+ if (!m_strncmp(buff, seq_unseen, m_strlen(seq_unseen)))
continue;
- if (!str_ncmp (buff, seq_flagged, m_strlen(seq_flagged)))
+ if (!m_strncmp(buff, seq_flagged, m_strlen(seq_flagged)))
continue;
- if (!str_ncmp (buff, seq_replied, m_strlen(seq_replied)))
+ if (!m_strncmp(buff, seq_replied, m_strlen(seq_replied)))
continue;
fprintf (nfp, "%s\n", buff);
h->read = 0;
h->replied = 0;
- if ((p = strrchr (path, ':')) != NULL && str_ncmp (p + 1, "2,", 2) == 0) {
+ if ((p = strrchr (path, ':')) != NULL && m_strncmp(p + 1, "2,", 2) == 0) {
p += 3;
str_replace (&h->maildir_flags, p);
char* val = (char*) p;
if (!val || !*val)
return (1);
- if (str_ncmp (val, "enabled", 7) != 0 &&
- str_ncmp (val, "required", 8) != 0) {
+ if (m_strncmp(val, "enabled", 7) != 0 &&
+ m_strncmp(val, "required", 8) != 0) {
if (errbuf)
snprintf (errbuf, errlen, _("'%s' is invalid for %s"), val, option);
return (0);
}
*q = 0;
- if (str_ncmp (s, Maildir, (len = m_strlen(Maildir))) == 0 &&
+ if (m_strncmp(s, Maildir, (len = m_strlen(Maildir))) == 0 &&
s[len] == '/') {
*s++ = '=';
memmove (s, s + len, m_strlen(s + len) + 1);
}
- else if (str_ncmp (s, Homedir, (len = m_strlen(Homedir))) == 0 &&
+ else if (m_strncmp(s, Homedir, (len = m_strlen(Homedir))) == 0 &&
s[len] == '/') {
*s++ = '~';
memmove (s, s + len - 1, m_strlen(s + len - 1) + 1);
rewind (index);
while (fgets (buf, sizeof (buf), index)) {
buf[m_strlen(buf) - 1] = 0; /* strip ending '\n' */
- if (!str_ncmp (buf, "#: ", 3) &&
- !str_casecmp (buf + 3, news->conn->account.host))
+ if (!m_strncmp(buf, "#: ", 3) &&
+ !m_strcasecmp(buf + 3, news->conn->account.host))
break;
}
while (fgets (buf, sizeof (buf), index)) {
c = buf;
while (*c && *c != '\n') c++;
c[0] = 0; /* strip EOL */
- if (!strncmp (buf, "#: ", 3) && !str_casecmp (buf+3, section))
+ if (!strncmp (buf, "#: ", 3) && !m_strcasecmp(buf+3, section))
done++;
}
if (r != EOF && !done) {
return -1;
}
- if (str_ncmp ("281", buf, 3)) {
+ if (m_strncmp("281", buf, 3)) {
conn->account.flags = flags;
mutt_error _("Login failed.");
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
- if (!str_ncmp ("200", buf, 3))
+ if (!m_strncmp("200", buf, 3))
mutt_message (_("Connected to %s. Posting ok."), conn->account.host);
- else if (!str_ncmp ("201", buf, 3))
+ else if (!m_strncmp("201", buf, 3))
mutt_message (_("Connected to %s. Posting NOT ok."), conn->account.host);
else {
mutt_socket_close (conn);
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
- if (!(conn->account.flags & M_ACCT_USER) && str_ncmp ("480", buf, 3)) {
+ if (!(conn->account.flags & M_ACCT_USER) && m_strncmp("480", buf, 3)) {
serv->status = NNTP_OK;
return 0;
}
mutt_socket_write (conn, "XOVER\r\n");
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
- if (str_ncmp ("500", buf, 3))
+ if (m_strncmp("500", buf, 3))
serv->hasXOVER = 1;
mutt_socket_write (conn, "XPAT\r\n");
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
- if (str_ncmp ("500", buf, 3))
+ if (m_strncmp("500", buf, 3))
serv->hasXPAT = 1;
#if WANT_LISTGROUP_COMMAND
mutt_socket_write (conn, "LISTGROUP\r\n");
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return (nntp_connect_error (serv));
- if (str_ncmp ("500", buf, 3))
+ if (m_strncmp("500", buf, 3))
serv->hasLISTGROUP = 1;
#endif
mutt_socket_write (conn, "XGTITLE +\r\n");
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
- if (str_ncmp ("500", buf, 3))
+ if (m_strncmp("500", buf, 3))
serv->hasXGTITLE = 1;
- if (!str_ncmp ("282", buf, 3)) {
+ if (!m_strncmp("282", buf, 3)) {
do {
if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
return nntp_connect_error (serv);
if (*line)
done = FALSE;
}
- else if ((!str_ncmp ("480", buf, 3)) && nntp_auth (data->nserv) < 0)
+ else if ((!m_strncmp("480", buf, 3)) && nntp_auth (data->nserv) < 0)
return -1;
} while (!done);
return -1;
}
- if (str_ncmp ("211", buf, 3)) {
+ if (m_strncmp("211", buf, 3)) {
LIST *l = serv->list;
/* GROUP command failed */
- if (!str_ncmp ("411", buf, 3)) {
+ if (!m_strncmp("411", buf, 3)) {
mutt_error (_("Newsgroup %s not found on server %s"),
nntp_data->group, serv->conn->account.host);
#endif
return -1;
}
- if (str_ncmp ("211", buf, 3)) {
+ if (m_strncmp("211", buf, 3)) {
buf[0] = 0;
if (mutt_nntp_query (nntp_data, buf, sizeof (buf)) < 0) {
#ifdef DEBUG
return -1;
}
}
- if (!str_ncmp ("211", buf, 3)) {
+ if (!m_strncmp("211", buf, 3)) {
int first;
int last;
if (length <= q_list->length) {
/* case 1: check the top level nodes */
- if (str_ncmp (qptr, q_list->prefix, length) == 0) {
+ if (m_strncmp(qptr, q_list->prefix, length) == 0) {
if (length == q_list->length)
return q_list; /* same prefix: return the current class */
/* tmp != NULL means we already found a shorter prefix at case 1 */
if (tmp == NULL
- && str_ncmp (qptr, q_list->prefix, q_list->length) == 0) {
+ && m_strncmp(qptr, q_list->prefix, q_list->length) == 0) {
/* ok, it's a subclass somewhere on this branch */
ptr = q_list;
while (q_list) {
if (length <= q_list->length) {
- if (str_ncmp (tail_qptr, (q_list->prefix) + offset, tail_lng)
+ if (m_strncmp(tail_qptr, (q_list->prefix) + offset, tail_lng)
== 0) {
/* same prefix: return the current class */
if (length == q_list->length)
else {
/* longer than the current prefix: try subclassing it */
if (tmp == NULL
- && str_ncmp (tail_qptr, (q_list->prefix) + offset,
+ && m_strncmp(tail_qptr, (q_list->prefix) + offset,
q_list->length - offset) == 0) {
/* still a subclass: go down one level */
ptr = q_list;
}
}
}
- else if (str_ncmp ("\033[0m", raw, 4) == 0) /* a little hack... */
+ else if (m_strncmp("\033[0m", raw, 4) == 0) /* a little hack... */
lineInfo[n].type = MT_COLOR_NORMAL;
#if 0
- else if (str_ncmp ("[-- ", buf, 4) == 0)
+ else if (m_strncmp("[-- ", buf, 4) == 0)
lineInfo[n].type = MT_COLOR_ATTACHMENT;
#else
else if (check_attachment_marker ((char *) raw) == 0)
else
followup_to = extra->hdr->env->followup_to;
- if (!followup_to || str_casecmp (followup_to, "poster") ||
+ if (!followup_to || m_strcasecmp(followup_to, "poster") ||
query_quadoption (OPT_FOLLOWUPTOPOSTER,
_("Reply by mail as poster prefers?")) != M_YES) {
if (extra->ctx && extra->ctx->magic == M_NNTP
crlf = (len > 1 && buffer[len - 2] == '\r') ? 1 : 0;
if (buffer[0] == '-' && buffer[1] == '-' &&
- str_ncmp (buffer + 2, boundary, blen) == 0) {
+ m_strncmp(buffer + 2, boundary, blen) == 0) {
if (last) {
last->length = ftello (fp) - last->offset - len - 1 - crlf;
if (last->parts && last->parts->length == 0)
matched = 1;
}
#ifdef USE_NNTP
- else if (!str_casecmp (line + 1, "ollowup-to")) {
+ else if (!m_strcasecmp(line + 1, "ollowup-to")) {
if (!e->followup_to) {
str_skip_trailws (p);
e->followup_to = m_strdup(str_skip_initws (p));
#ifdef USE_NNTP
case 'n':
- if (!str_casecmp (line + 1, "ewsgroups")) {
+ if (!m_strcasecmp(line + 1, "ewsgroups")) {
p_delete(&e->newsgroups);
str_skip_trailws (p);
e->newsgroups = m_strdup(str_skip_initws (p));
case 'o':
/* field `Organization:' saves only for pager! */
- if (!str_casecmp (line + 1, "rganization")) {
- if (!e->organization && str_casecmp (p, "unknown"))
+ if (!m_strcasecmp(line + 1, "rganization")) {
+ if (!e->organization && m_strcasecmp(p, "unknown"))
e->organization = m_strdup(p);
}
break;
matched = 1;
}
#ifdef USE_NNTP
- else if (!str_casecmp (line + 1, "-comment-to")) {
+ else if (!m_strcasecmp(line + 1, "-comment-to")) {
if (!e->x_comment_to)
e->x_comment_to = m_strdup(p);
matched = 1;
}
- else if (!str_casecmp (line + 1, "ref")) {
+ else if (!m_strcasecmp(line + 1, "ref")) {
if (!e->xref)
e->xref = m_strdup(p);
matched = 1;
time_t t;
/* some bogus MTAs will quote the original "From " line */
- if (str_ncmp (">From ", line, 6) == 0)
+ if (m_strncmp(">From ", line, 6) == 0)
continue; /* just ignore */
else if (is_from (line, return_path, sizeof (return_path), &t)) {
/* MH somtimes has the From_ line in the middle of the header! */
} else if (bp->type == TYPEMULTIPART) {
/* Always recurse multiparts, except multipart/alternative. */
shallrecurse = 1;
- if (!str_casecmp(bp->subtype, "alternative"))
+ if (!m_strcasecmp(bp->subtype, "alternative"))
shallrecurse = 0;
/* Don't count containers if they're top-level. */
}
/* record new limit pattern, unless match all */
- if (str_ncmp (buf, "~A", 2) != 0) {
+ if (m_strncmp(buf, "~A", 2) != 0) {
Context->pattern = simple;
simple = NULL; /* don't clobber it */
Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);
bytes -= (offset - last_pos); /* don't rely on m_strlen(buf) */
last_pos = offset;
- if (str_ncmp ("-----BEGIN PGP ", buf, 15) == 0) {
+ if (m_strncmp("-----BEGIN PGP ", buf, 15) == 0) {
clearsign = 0;
start_pos = last_pos;
}
while (fgets (buf, sizeof (buf), tfp)) {
- if (str_ncmp ("-----BEGIN PGP ", buf, 15) == 0) {
+ if (m_strncmp("-----BEGIN PGP ", buf, 15) == 0) {
if (m_strcmp("MESSAGE-----\n", buf + 15) == 0)
enc = 1;
else if (m_strcmp("SIGNED MESSAGE-----\n", buf + 15) == 0)
pgp_uid_t **s = (pgp_uid_t **) a;
pgp_uid_t **t = (pgp_uid_t **) b;
- if ((r = str_casecmp ((*s)->addr, (*t)->addr)))
+ if ((r = m_strcasecmp((*s)->addr, (*t)->addr)))
return r > 0;
else
- return (str_casecmp (_pgp_keyid ((*s)->parent),
+ return (m_strcasecmp(_pgp_keyid ((*s)->parent),
_pgp_keyid ((*t)->parent)) > 0);
}
pgp_uid_t **s = (pgp_uid_t **) a;
pgp_uid_t **t = (pgp_uid_t **) b;
- if ((r = str_casecmp (_pgp_keyid ((*s)->parent),
+ if ((r = m_strcasecmp(_pgp_keyid ((*s)->parent),
_pgp_keyid ((*t)->parent))))
return r > 0;
else
- return (str_casecmp ((*s)->addr, (*t)->addr)) > 0;
+ return (m_strcasecmp((*s)->addr, (*t)->addr)) > 0;
}
static int pgp_compare_keyid (const void *a, const void *b)
if ((r = ((*s)->parent->gen_time - (*t)->parent->gen_time)))
return r > 0;
- return (str_casecmp ((*s)->addr, (*t)->addr)) > 0;
+ return (m_strcasecmp((*s)->addr, (*t)->addr)) > 0;
}
static int pgp_compare_date (const void *a, const void *b)
return r < 0;
if ((r = ((*s)->parent->gen_time - (*t)->parent->gen_time)))
return r < 0;
- if ((r = str_casecmp ((*s)->addr, (*t)->addr)))
+ if ((r = m_strcasecmp((*s)->addr, (*t)->addr)))
return r > 0;
- return (str_casecmp (_pgp_keyid ((*s)->parent),
+ return (m_strcasecmp(_pgp_keyid ((*s)->parent),
_pgp_keyid ((*t)->parent))) > 0;
}
rv |= PGP_KV_STRONGID;
if (addr->mailbox && u_addr->mailbox
- && str_casecmp (addr->mailbox, u_addr->mailbox) == 0)
+ && m_strcasecmp(addr->mailbox, u_addr->mailbox) == 0)
rv |= PGP_KV_ADDR;
if (addr->personal && u_addr->personal
- && str_casecmp (addr->personal, u_addr->personal) == 0)
+ && m_strcasecmp(addr->personal, u_addr->personal) == 0)
rv |= PGP_KV_STRING;
return rv;
if (whatfor) {
for (l = id_defaults; l; l = l->next)
- if (!str_casecmp (whatfor, l->what)) {
+ if (!m_strcasecmp(whatfor, l->what)) {
strfcpy (resp, NONULL (l->dflt), sizeof (resp));
break;
}
for (a = k->address; a; a = a->next) {
debug_print (5, ("matching \"%s\" against key %s, \"%s\":\n", p, pgp_keyid (k), a->addr));
- if (!*p || str_casecmp (p, pgp_keyid (k)) == 0
- || (!str_ncasecmp (p, "0x", 2)
- && !str_casecmp (p + 2, pgp_keyid (k)))
- || (option (OPTPGPLONGIDS) && !str_ncasecmp (p, "0x", 2)
- && !str_casecmp (p + 2, k->keyid + 8))
+ if (!*p || m_strcasecmp(p, pgp_keyid (k)) == 0
+ || (!m_strncasecmp(p, "0x", 2)
+ && !m_strcasecmp(p + 2, pgp_keyid (k)))
+ || (option (OPTPGPLONGIDS) && !m_strncasecmp(p, "0x", 2)
+ && !m_strcasecmp(p + 2, k->keyid + 8))
|| str_isstr (a->addr, p)) {
debug_print (5, ("match.\n"));
match = 1;
break;
#ifdef USE_SASL
- if (!str_ncmp (inbuf, "+ ", 2)
+ if (!m_strncmp(inbuf, "+ ", 2)
&& sasl_decode64 (inbuf, strlen (inbuf), buf, LONG_STRING - 1,
&len) != SASL_OK)
#endif
if (rc != SASL_OK)
goto bail;
- if (!str_ncmp (inbuf, "+OK", 3)) {
+ if (!m_strncmp(inbuf, "+OK", 3)) {
mutt_sasl_setup_conn (pop_data->conn, saslconn);
return POP_A_SUCCESS;
}
sasl_dispose (&saslconn);
/* terminate SASL sessoin if the last responce is not +OK nor -ERR */
- if (!str_ncmp (inbuf, "+ ", 2)) {
+ if (!m_strncmp(inbuf, "+ ", 2)) {
snprintf (buf, sizeof (buf), "*\r\n");
if (pop_query (pop_data, buf, sizeof (buf)) == PQ_NOT_CONNECTED)
return POP_A_SOCKET;
t = strchr (pop_data->err_msg, '\0');
c = msg;
- if (!str_ncmp (msg, "-ERR ", 5)) {
+ if (!m_strncmp(msg, "-ERR ", 5)) {
c2 = msg + 5;
SKIPWS (c2);
pop_data->status = POP_CONNECTED;
- if (str_ncmp (buf, "+OK", 3)) {
+ if (m_strncmp(buf, "+OK", 3)) {
*pop_data->err_msg = '\0';
pop_error (pop_data, buf);
mutt_error ("%s", pop_data->err_msg);
pop_data->status = POP_DISCONNECTED;
return PQ_NOT_CONNECTED;
}
- if (!str_ncmp (buf, "+OK", 3))
+ if (!m_strncmp(buf, "+OK", 3))
return PQ_OK;
pop_error (pop_data, buf);
tmp = next;
}
else if ((WithCrypto & APPLICATION_PGP)
- && (str_ncmp ("Pgp:", tmp->data, 4) == 0 /* this is generated
+ && (m_strncmp("Pgp:", tmp->data, 4) == 0 /* this is generated
* by old mutt versions
*/
- || str_ncmp ("X-Mutt-PGP:", tmp->data, 11) == 0)) {
+ || m_strncmp("X-Mutt-PGP:", tmp->data, 11) == 0)) {
hdr->security = mutt_parse_crypt_hdr (strchr (tmp->data, ':') + 1, 1);
hdr->security |= APPLICATION_PGP;
tmp = next;
}
else if ((WithCrypto & APPLICATION_SMIME)
- && str_ncmp ("X-Mutt-SMIME:", tmp->data, 13) == 0) {
+ && m_strncmp("X-Mutt-SMIME:", tmp->data, 13) == 0) {
hdr->security = mutt_parse_crypt_hdr (strchr (tmp->data, ':') + 1, 1);
hdr->security |= APPLICATION_SMIME;
}
#ifdef MIXMASTER
- else if (str_ncmp ("X-Mutt-Mix:", tmp->data, 11) == 0) {
+ else if (m_strncmp("X-Mutt-Mix:", tmp->data, 11) == 0) {
char *t;
mutt_free_list (&hdr->chain);
CHECK_ATTACH;
if (!idx[menu->current]->content->hdr->env->followup_to ||
- str_casecmp (idx[menu->current]->content->hdr->env->followup_to,
+ m_strcasecmp(idx[menu->current]->content->hdr->env->followup_to,
"poster")
|| query_quadoption (OPT_FOLLOWUPTOPOSTER,
_("Reply by mail as poster prefers?")) !=
if ((flags & SENDNEWS)) {
/* in case followup set Newsgroups: with Followup-To: if it present */
if (!env->newsgroups && curenv &&
- str_casecmp (curenv->followup_to, "poster"))
+ m_strcasecmp(curenv->followup_to, "poster"))
env->newsgroups = m_strdup(curenv->followup_to);
}
else
if ((flags & SENDNEWS)) {
/* in case followup set Newsgroups: with Followup-To: if it present */
if (!env->newsgroups && curenv &&
- str_casecmp (curenv->followup_to, "poster"))
+ m_strcasecmp(curenv->followup_to, "poster"))
env->newsgroups = m_strdup(curenv->followup_to);
}
else
}
/* Escape lines that begin with/only contain "the message separator". */
- if (linelen == 4 && !str_ncmp ("From", line, 4)) {
+ if (linelen == 4 && !m_strncmp("From", line, 4)) {
strfcpy (line, "=46rom", sizeof (line));
linelen = 6;
}
- else if (linelen == 4 && !str_ncmp ("from", line, 4)) {
+ else if (linelen == 4 && !m_strncmp("from", line, 4)) {
strfcpy (line, "=66rom", sizeof (line));
linelen = 6;
}
while ((p = strtok (p, " \t\n"))) {
sze = m_strlen(p);
if ((sze > cur_sze) && (szf >= sze) &&
- (str_casecmp (path + szf - sze, p) == 0
+ (m_strcasecmp(path + szf - sze, p) == 0
|| ascii_strcasecmp (path + szf - sze, p) == 0) && (szf == sze
|| path[szf
-
memset(&entry, ' ', sizeof(entry));
#if USE_IMAP
- if (l > 0 && str_ncmp (box, ImapHomeNamespace, l) == 0 &&
+ if (l > 0 && m_strncmp(box, ImapHomeNamespace, l) == 0 &&
m_strlen(box) > l)
box += l + 1; /* we're trimming the ImapHomeNamespace, the "+ 1" is for the separator */
else
#endif
- if (l_m > 0 && str_ncmp (box, Maildir, l_m) == 0 &&
+ if (l_m > 0 && m_strncmp(box, Maildir, l_m) == 0 &&
m_strlen(box) > l_m) {
box += l_m;
if (Maildir[strlen(Maildir)-1]!='/') {
}
while (fgets (buf, sizeof (buf) - 1, fp) != NULL)
- if (mailbox && !(str_ncasecmp (mailbox, buf, addr_len))) {
+ if (mailbox && !(m_strncasecmp(mailbox, buf, addr_len))) {
numFields = sscanf (buf,
MUTT_FORMAT (STRING) " " MUTT_FORMAT (STRING) " "
MUTT_FORMAT (STRING) " " MUTT_FORMAT (STRING) " "
/* query = label: return certificate. */
if (numFields >= 3 &&
- !(str_ncasecmp (query, fields[2], query_len))) {
+ !(m_strncasecmp(query, fields[2], query_len))) {
ask = 0;
strfcpy (key, fields[1], sizeof (key));
}
/* query = certificate: return intermediate certificate. */
else if (numFields >= 4 &&
- !(str_ncasecmp (query, fields[1], query_len))) {
+ !(m_strncasecmp(query, fields[1], query_len))) {
ask = 0;
strfcpy (key, fields[3], sizeof (key));
}
if (k) {
/* the key used last time. */
if (*SmimeKeyToUse &&
- !str_casecmp (k, SmimeKeyToUse + m_strlen(SmimeKeys) + 1)) {
+ !m_strcasecmp(k, SmimeKeyToUse + m_strlen(SmimeKeys) + 1)) {
p_delete(&k);
return;
}
snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s",
NONULL (SmimeCertificates), k);
- if (str_casecmp (k, SmimeDefaultKey))
+ if (m_strcasecmp(k, SmimeDefaultKey))
smime_void_passphrase ();
p_delete(&k);
}
if (*SmimeKeyToUse) {
- if (!str_casecmp (SmimeDefaultKey,
+ if (!m_strcasecmp(SmimeDefaultKey,
SmimeKeyToUse + m_strlen(SmimeKeys) + 1))
return;
while ((fgets (email, sizeof (email), fpout))) {
*(email + m_strlen(email) - 1) = '\0';
- if (str_ncasecmp (email, mailbox, m_strlen(mailbox)) == 0)
+ if (m_strncasecmp(email, mailbox, m_strlen(mailbox)) == 0)
ret = 1;
ret = ret < 0 ? 0 : ret;
rewind (smimeerr);
line = mutt_read_line (line, &linelen, smimeerr, &lineno);
- if (linelen && !str_casecmp (line, "verification successful"))
+ if (linelen && !m_strcasecmp(line, "verification successful"))
badsig = 0;
p_delete(&line);
rewind (smimeerr);
line = mutt_read_line (line, &linelen, smimeerr, &lineno);
- if (linelen && !str_casecmp (line, "verification successful"))
+ if (linelen && !m_strcasecmp(line, "verification successful"))
m->goodsig = 1;
p_delete(&line);
}
else if (!(*pb)->env->real_subj)
rc = 1;
else
- rc = str_casecmp ((*pa)->env->real_subj, (*pb)->env->real_subj);
+ rc = m_strcasecmp((*pa)->env->real_subj, (*pb)->env->real_subj);
AUXSORT (rc, a, b);
return (SORTCODE (rc));
}
m_strcpy(fa, sizeof(fa), mutt_get_name((*ppa)->env->to));
m_strcpy(fb, sizeof(fb), mutt_get_name((*ppb)->env->to));
- result = str_casecmp (fa, fb);
+ result = m_strcasecmp(fa, fb);
AUXSORT (result, a, b);
return (SORTCODE (result));
}
m_strcpy(fa, sizeof(fa), mutt_get_name((*ppa)->env->from));
m_strcpy(fb, sizeof(fb), mutt_get_name((*ppb)->env->from));
- result = str_casecmp (fa, fb);
+ result = m_strcasecmp(fa, fb);
AUXSORT (result, a, b);
return (SORTCODE (result));
}
for (p = brk; !done && p; p = p->parent)
for (ref = cur->message->env->references; p->message && ref;
ref = ref->next)
- if (!str_casecmp (ref->data, p->message->env->message_id)) {
+ if (!m_strcasecmp(ref->data, p->message->env->message_id)) {
done = 1;
break;
}