#endif
if (a1->flags & a2->flags & M_ACCT_USER)
- return (!str_cmp (a1->user, a2->user));
+ return (!m_strcmp(a1->user, a2->user));
if (a1->flags & M_ACCT_USER)
- return (!str_cmp (a1->user, user));
+ return (!m_strcmp(a1->user, user));
if (a2->flags & M_ACCT_USER)
- return (!str_cmp (a2->user, user));
+ return (!m_strcmp(a2->user, user));
return 1;
}
if (t) {
i = 0;
for (u = *expn; u; u = u->next) {
- if (str_cmp (a->mailbox, u->data) == 0) { /* alias already found */
+ if (m_strcmp(a->mailbox, u->data) == 0) { /* alias already found */
debug_print(1, ("loop in alias found for '%s'\n", a->mailbox));
i = 1;
break;
}
if (bestname[0] != 0) {
- if (str_cmp (bestname, s) != 0) {
+ if (m_strcmp(bestname, s) != 0) {
/* we are adding something to the completion */
strfcpy (s, bestname, m_strlen(bestname) + 1);
return 1;
int lng;
if ((p = getenv ("MM_NOASK")) != NULL && *p) {
- if (str_cmp (p, "1") == 0)
+ if (m_strcmp(p, "1") == 0)
return (1);
strfcpy (tmp, p, sizeof (tmp));
if (rfc1524_expand_filename (entry->nametemplate, fname,
tempfile, sizeof (tempfile))) {
- if (fp == NULL && str_cmp (tempfile, a->filename)) {
+ if (fp == NULL && m_strcmp(tempfile, a->filename)) {
/* send case: the file is already there */
if (safe_symlink (a->filename, tempfile) == -1) {
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES)
init_state (state, menu);
while ((de = readdir (dp)) != NULL) {
- if (str_cmp (de->d_name, ".") == 0)
+ if (m_strcmp(de->d_name, ".") == 0)
continue; /* we don't need . */
if (prefix && *prefix
/* save the old directory */
strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
- if (str_cmp (state.entry[menu->current].name, "..") == 0) {
- if (str_cmp ("..", LastDir + m_strlen(LastDir) - 2) == 0)
+ if (m_strcmp(state.entry[menu->current].name, "..") == 0) {
+ if (m_strcmp("..", LastDir + m_strlen(LastDir) - 2) == 0)
strcat (LastDir, "/.."); /* __STRCAT_CHECKED__ */
else {
char *p = strrchr (LastDir + 1, '/');
do {
mutt_extract_token (buf, s, 0);
- if (!str_cmp ("*", buf->data)) {
+ if (!m_strcmp("*", buf->data)) {
for (tmp = ColorIndexList; tmp;) {
if (!do_cache)
do_cache = 1;
else {
for (last = NULL, tmp = ColorIndexList; tmp;
last = tmp, tmp = tmp->next) {
- if (!str_cmp (buf->data, tmp->pattern)) {
+ if (!m_strcmp(buf->data, tmp->pattern)) {
if (!do_cache)
do_cache = 1;
debug_print (1, ("Freeing pattern \"%s\" from ColorIndexList\n", tmp->pattern));
while (tmp) {
if (sensitive) {
- if (str_cmp (s, tmp->pattern) == 0)
+ if (m_strcmp(s, tmp->pattern) == 0)
break;
}
else {
}
}
- if (!Pager || str_cmp (Pager, "builtin") == 0)
+ if (!Pager || m_strcmp(Pager, "builtin") == 0)
builtin = 1;
else {
mutt_make_string (buf, sizeof (buf), NONULL (PagerFmt), Context, cur);
/* This is an undocumented feature of ELM pointed out to me by Felix von
* Leitner <leitner@prz.fu-berlin.de>
*/
- if (str_cmp (buf, ".") == 0)
+ if (m_strcmp(buf, ".") == 0)
strfcpy (buf, LastSaveFolder, sizeof (buf));
else
strfcpy (LastSaveFolder, buf, sizeof (LastSaveFolder));
*/
if ((len = m_strlen(filepart)) == 0) {
while ((de = readdir (dirp)) != NULL) {
- if (str_cmp (".", de->d_name) != 0
- && str_cmp ("..", de->d_name) != 0) {
+ if (m_strcmp(".", de->d_name) != 0
+ && m_strcmp("..", de->d_name) != 0) {
strfcpy (filepart, de->d_name, sizeof (filepart));
init++;
break;
if (dirpart[0]) {
strfcpy (s, dirpart, slen);
- if (str_cmp ("/", dirpart) != 0 && dirpart[0] != '='
+ if (m_strcmp("/", dirpart) != 0 && dirpart[0] != '='
&& dirpart[0] != '+')
strfcpy (s + m_strlen(s), "/", slen - m_strlen(s));
strfcpy (s + m_strlen(s), filepart, slen - m_strlen(s));
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
- if (Editor && (str_cmp ("builtin", Editor) != 0)
+ if (Editor && (m_strcmp("builtin", Editor) != 0)
&& !option (OPTEDITHDRS)) {
mutt_edit_file (Editor, msg->content->filename);
mutt_update_encoding (msg->content);
}
/* fall through */
case OP_COMPOSE_EDIT_HEADERS:
- if (str_cmp ("builtin", Editor) != 0 &&
+ if (m_strcmp("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
const char *tag = NULL, *err = NULL;
state_attach_puts (": ", s);
if (t0)
state_attach_puts (t0, s);
- if (t1 && !(t0 && !str_cmp (t0, t1))) {
+ if (t1 && !(t0 && !m_strcmp(t0, t1))) {
if (t0)
state_attach_puts (",", s);
state_attach_puts (t1, s);
while (fgets (buf, sizeof (buf), tfp)) {
if (!str_ncmp ("-----BEGIN PGP ", buf, 15)) {
- if (!str_cmp ("MESSAGE-----\n", buf + 15))
+ if (!m_strcmp("MESSAGE-----\n", buf + 15))
enc = 1;
- else if (!str_cmp ("SIGNED MESSAGE-----\n", buf + 15))
+ else if (!m_strcmp("SIGNED MESSAGE-----\n", buf + 15))
sgn = 1;
}
}
continue;
}
- if (!str_cmp (buf, "-----BEGIN PGP SIGNATURE-----\n"))
+ if (!m_strcmp(buf, "-----BEGIN PGP SIGNATURE-----\n"))
break;
if (armor_header) {
clearsign = 0;
start_pos = last_pos;
- if (!str_cmp ("MESSAGE-----\n", buf + 15))
+ if (!m_strcmp("MESSAGE-----\n", buf + 15))
needpass = 1;
- else if (!str_cmp ("SIGNED MESSAGE-----\n", buf + 15)) {
+ else if (!m_strcmp("SIGNED MESSAGE-----\n", buf + 15)) {
clearsign = 1;
needpass = 0;
}
else if (!option (OPTDONTHANDLEPGPKEYS) &&
- !str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15)) {
+ !m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15)) {
needpass = 0;
pgp_keyblock = 1;
}
gpgme_data_write (armored_data, buf, m_strlen(buf));
- if ((needpass && !str_cmp ("-----END PGP MESSAGE-----\n", buf))
+ if ((needpass && !m_strcmp("-----END PGP MESSAGE-----\n", buf))
|| (!needpass
- && (!str_cmp ("-----END PGP SIGNATURE-----\n", buf)
- || !str_cmp ("-----END PGP PUBLIC KEY BLOCK-----\n",
+ && (!m_strcmp("-----END PGP SIGNATURE-----\n", buf)
+ || !m_strcmp("-----END PGP PUBLIC KEY BLOCK-----\n",
buf))))
break;
}
int any = 0;
for (; dn->key; dn++) {
- if (!str_cmp (dn->key, key)) {
+ if (!m_strcmp(dn->key, key)) {
if (any)
fputs (" + ", fp);
print_utf8 (fp, dn->value, m_strlen(dn->value));
/* now print the rest without any specific ordering */
for (; dn->key; dn++) {
for (i = 0; stdpart[i]; i++) {
- if (!str_cmp (dn->key, stdpart[i]))
+ if (!m_strcmp(dn->key, stdpart[i]))
break;
}
if (!stdpart[i]) {
k = key->kobj;
gpgme_key_ref (k);
- while ((s = k->chain_id) && k->subkeys && str_cmp (s, k->subkeys->fpr)) {
+ while ((s = k->chain_id) && k->subkeys && m_strcmp(s, k->subkeys->fpr)) {
putc ('\n', fp);
err = gpgme_op_keylist_start (listctx, s, 0);
gpgme_key_release (k);
{
int rc;
- if (!Pager || str_cmp (Pager, "builtin") == 0)
+ if (!Pager || m_strcmp(Pager, "builtin") == 0)
rc = mutt_pager (banner, tempfile, do_color, info);
else {
char cmd[STRING];
break;
}
}
- else if (str_cmp (".", tmp) == 0)
+ else if (m_strcmp(".", tmp) == 0)
done = 1;
else {
str_cat (tmp, sizeof (tmp), "\n");
{
debug_print (2, ("record type: %s\n", p));
- if (!str_cmp (p, "pub"));
- else if (!str_cmp (p, "sub"))
+ if (!m_strcmp(p, "pub"));
+ else if (!m_strcmp(p, "sub"))
*is_subkey = 1;
- else if (!str_cmp (p, "sec"));
- else if (!str_cmp (p, "ssb"))
+ else if (!m_strcmp(p, "sec"));
+ else if (!m_strcmp(p, "ssb"))
*is_subkey = 1;
- else if (!str_cmp (p, "uid"))
+ else if (!m_strcmp(p, "uid"))
is_uid = 1;
else
return NULL;
}
if (ismacro > 0) {
- if (!str_cmp (Pager, "builtin"))
+ if (!m_strcmp(Pager, "builtin"))
fputs ("_\010", f);
fputs ("M ", f);
col += 2;
print_macro (f, n, &t3);
if (*t3) {
- if (str_cmp (Pager, "builtin")) {
+ if (m_strcmp(Pager, "builtin")) {
fputc ('\n', f);
n = 0;
}
prev = h->last - 1;
if (prev < 0)
prev = HistSize - 1;
- if (!h->hist[prev] || str_cmp (h->hist[prev], s) != 0) {
+ if (!h->hist[prev] || m_strcmp(h->hist[prev], s) != 0) {
str_replace (&h->hist[h->last++], s);
if (h->last > HistSize - 1)
h->last = 0;
/* check to make sure that a matching hook doesn't already exist */
for (ptr = Hooks; ptr; ptr = ptr->next) {
if (ptr->type == data &&
- ptr->rx.not == not && !str_cmp (pattern.data, ptr->rx.pattern)) {
+ ptr->rx.not == not && !m_strcmp(pattern.data, ptr->rx.pattern)) {
if (data &
(M_FOLDERHOOK | M_SENDHOOK | M_SEND2HOOK | M_MESSAGEHOOK |
M_ACCOUNTHOOK | M_REPLYHOOK)) {
/* these hooks allow multiple commands with the same
* pattern, so if we've already seen this pattern/command pair, just
* ignore it instead of creating a duplicate */
- if (!str_cmp (ptr->command, command.data)) {
+ if (!m_strcmp(ptr->command, command.data)) {
p_delete(&command.data);
p_delete(&pattern.data);
return 0;
{
while (MoreArgs (s)) {
mutt_extract_token (buf, s, 0);
- if (str_cmp ("*", buf->data) == 0) {
+ if (m_strcmp("*", buf->data) == 0) {
if (current_hook_type) {
snprintf (err->data, err->dsize,
_("unhook: Can't do unhook * from within a hook."));
static int compare_names (struct folder_file *a, struct folder_file *b)
{
- return str_cmp (a->name, b->name);
+ return m_strcmp(a->name, b->name);
}
static int browse_get_namespace (IMAP_DATA * idata, char *nsbuf, int nsblen,
strfcpy (buf, "mailboxes \"", sizeof (buf));
mutt_account_tourl (&idata->conn->account, &url);
url.path = s;
- if (!str_cmp (url.user, ImapUser))
+ if (!m_strcmp(url.user, ImapUser))
url.user = NULL;
url_ciss_tostring (&url, buf + 11, sizeof (buf) - 10, 0);
str_cat (buf, sizeof (buf), "\"");
* command on a mailbox that you have selected
*/
- if (str_cmp (mbox_unquoted, idata->mailbox) == 0
+ if (m_strcmp(mbox_unquoted, idata->mailbox) == 0
|| (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
&& str_casecmp (mbox_unquoted, idata->mailbox) == 0)) {
strfcpy (buf, "NOOP", sizeof (buf));
static void num_to_string (char* dst, size_t dstlen,
struct option_t* option) {
/* XXX puke */
- const char* fmt = (str_cmp (option->option, "umask") == 0) ?
+ const char* fmt = (m_strcmp(option->option, "umask") == 0) ?
"%s=%04o" : "%s=%d";
snprintf (dst, dstlen, fmt, option->option,
*((short*) option->data));
if (!dst)
return (0);
- if (option (OPTATTACHMSG) && !str_cmp (dst->option, "reply_regexp")) {
+ if (option (OPTATTACHMSG) && !m_strcmp(dst->option, "reply_regexp")) {
if (errbuf)
snprintf (errbuf, errlen,
"Operation not permitted when in attach-message mode.");
p = (rx_t*) dst->data;
/* something to do? */
- if (!val || !*val || (p->pattern && str_cmp (p->pattern, val) == 0))
+ if (!val || !*val || (p->pattern && m_strcmp(p->pattern, val) == 0))
return (1);
- if (str_cmp (dst->option, "mask") != 0)
+ if (m_strcmp(dst->option, "mask") != 0)
flags |= mutt_which_case (val);
s = (char*) val;
- if (str_cmp (dst->option, "mask") == 0 && *s == '!') {
+ if (m_strcmp(dst->option, "mask") == 0 && *s == '!') {
not = 1;
s++;
}
p->rx = rx;
p->not = not;
- if (str_cmp (dst->option, "reply_regexp") == 0)
+ if (m_strcmp(dst->option, "reply_regexp") == 0)
mutt_adjust_all_subjects ();
return (1);
spam = *list;
if (!spam)
return 0;
- if (spam->rx && !str_cmp (spam->rx->pattern, pat)) {
+ if (spam->rx && !m_strcmp(spam->rx->pattern, pat)) {
*list = spam->next;
rx_free (&spam->rx);
p_delete(&spam->template);
prev = spam;
for (spam = prev->next; spam;) {
- if (!str_cmp (spam->rx->pattern, pat)) {
+ if (!m_strcmp(spam->rx->pattern, pat)) {
prev->next = spam->next;
rx_free (&spam->rx);
p_delete(&spam->template);
{
LIST *p, *last = NULL;
- if (str_cmp ("*", str) == 0)
+ if (m_strcmp("*", str) == 0)
mutt_free_list (l); /* ``unCMD *'' means delete all current entries */
else {
p = *l;
{
int i = 0;
- if (str_cmp ("*", str) == 0) {
+ if (m_strcmp("*", str) == 0) {
list_del (l, (list_del_t*) rx_free);
return (0);
}
mutt_extract_token (buf, s, 0);
remove_from_rx_list (&Alternates, buf->data);
- if (str_cmp (buf->data, "*") &&
+ if (m_strcmp(buf->data, "*") &&
add_to_rx_list (&UnAlternates, buf->data, REG_ICASE, err) != 0)
return -1;
/* nospam only ever has one parameter. */
/* "*" is a special case. */
- if (!str_cmp (buf->data, "*")) {
+ if (!m_strcmp(buf->data, "*")) {
mutt_free_spam_list (&SpamList);
list_del (&NoSpamList, (list_del_t*) rx_free);
return 0;
/*
* Check for deletion of entire list
*/
- if (str_cmp (buf->data, "*") == 0) {
+ if (m_strcmp(buf->data, "*") == 0) {
mutt_free_list ((LIST **) data);
break;
}
remove_from_rx_list (&SubscribedLists, buf->data);
remove_from_rx_list (&MailLists, buf->data);
- if (str_cmp (buf->data, "*") &&
+ if (m_strcmp(buf->data, "*") &&
add_to_rx_list (&UnMailLists, buf->data, REG_ICASE, err) != 0)
return -1;
}
mutt_extract_token (buf, s, 0);
remove_from_rx_list (&SubscribedLists, buf->data);
- if (str_cmp (buf->data, "*") &&
+ if (m_strcmp(buf->data, "*") &&
add_to_rx_list (&UnSubscribedLists, buf->data, REG_ICASE, err) != 0)
return -1;
}
do {
mutt_extract_token (buf, s, 0);
- if (str_cmp ("*", buf->data) == 0) {
+ if (m_strcmp("*", buf->data) == 0) {
if (CurrentMenu == MENU_ALIAS) {
for (tmp = Aliases; tmp; tmp = tmp->next)
tmp->del = 1;
do {
mutt_extract_token (buf, s, 0);
- if (str_cmp ("*", buf->data) == 0)
+ if (m_strcmp("*", buf->data) == 0)
mutt_free_list (&UserHeader);
else {
tmp = UserHeader;
int i = 0;
for (i = 0; SpecialVars[i].name; i++) {
- if (str_cmp (SpecialVars[i].name, name) == 0) {
+ if (m_strcmp(SpecialVars[i].name, name) == 0) {
return (SpecialVars[i].check (SpecialVars[i].name,
val, errbuf, errlen));
}
}
}
- if (!option && !(reset && str_cmp ("all", tmp->data) == 0)) {
+ if (!option && !(reset && m_strcmp("all", tmp->data) == 0)) {
snprintf (err->data, err->dsize, _("%s: unknown variable"), tmp->data);
return (-1);
}
return (-1);
}
- if (!str_cmp ("all", tmp->data)) {
+ if (!m_strcmp("all", tmp->data)) {
if (CurrentMenu == MENU_PAGER) {
snprintf (err->data, err->dsize, _("Not available in this menu."));
return (-1);
}
mutt_extract_token (token, &expn, 0);
for (i = 0; Commands[i].name; i++) {
- if (!str_cmp (token->data, Commands[i].name)) {
+ if (!m_strcmp(token->data, Commands[i].name)) {
if (Commands[i].func (token, &expn, Commands[i].data, err) != 0)
goto finish;
break;
/* compare two option_t*'s for sorting -t/-T output */
static int opt_cmp (const void* a, const void* b) {
- return (str_cmp ((*(struct option_t**) a)->option,
+ return (m_strcmp((*(struct option_t**) a)->option,
(*(struct option_t**) b)->option));
}
return;
mutt_option_value (option->option, buf, sizeof(buf));
- if (str_cmp (buf, option->init) != 0)
+ if (m_strcmp(buf, option->init) != 0)
list_push_back (l, option);
}
int i;
for (i = 0; bindings[i].name; i++)
- if (str_cmp (func, bindings[i].name) == 0) {
+ if (m_strcmp(func, bindings[i].name) == 0) {
km_bindkey (key, menu, bindings[i].op);
return (0);
}
int ascii_strcasecmp(const char *a, const char *b);
int ascii_strncasecmp(const char *a, const char *b, int n);
-#define ascii_strcmp(a,b) str_cmp(a,b)
+#define ascii_strcmp(a,b) m_strcmp(a,b)
#define ascii_strncmp(a,b,c) str_ncmp(a,b,c)
#endif /* MUTT_LIB_LIB_ASCII_H */
}
int rx_compare (const rx_t* r1, const rx_t* r2) {
- return (str_cmp (r1->pattern, r2->pattern));
+ return (m_strcmp(r1->pattern, r2->pattern));
}
int rx_list_match (list2_t* l, const char* pat) {
if (!pat || !*pat || list_empty(l))
return (-1);
for (i = 0; i < l->length; i++)
- if (str_cmp (((rx_t*) l->data[i])->pattern, pat) == 0)
+ if (m_strcmp(((rx_t*) l->data[i])->pattern, pat) == 0)
return (i);
return (-1);
}
return p;
}
-int str_cmp (const char *a, const char *b)
-{
- return strcmp (NONULL (a), NONULL (b));
-}
-
int str_casecmp (const char *a, const char *b)
{
return strcasecmp (NONULL (a), NONULL (b));
*/
char *str_cat (char*, size_t, const char*);
char *str_ncat (char*, size_t, const char*, size_t);
-int str_cmp (const char*, const char*);
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);
if (infile || bodytext) {
if (infile) {
- if (str_cmp ("-", infile) == 0)
+ if (m_strcmp("-", infile) == 0)
fin = stdin;
else {
char path[_POSIX_PATH_MAX];
if (fgets (buf, sizeof (buf) - 1, ctx->fp) == NULL)
break;
- if (str_cmp (buf, MMDF_SEP) == 0) {
+ if (m_strcmp(buf, MMDF_SEP) == 0) {
loc = ftello (ctx->fp);
count++;
if (0 < tmploc && tmploc < ctx->size) {
if (fseeko (ctx->fp, tmploc, SEEK_SET) != 0 ||
fgets (buf, sizeof (buf) - 1, ctx->fp) == NULL ||
- str_cmp (MMDF_SEP, buf) != 0) {
+ m_strcmp(MMDF_SEP, buf) != 0) {
if (fseeko (ctx->fp, loc, SEEK_SET) != 0)
debug_print (1, ("fseeko() failed\n"));
hdr->content->length = -1;
if (fgets (buf, sizeof (buf) - 1, ctx->fp) == NULL)
break;
lines++;
- } while (str_cmp (buf, MMDF_SEP) != 0);
+ } while (m_strcmp(buf, MMDF_SEP) != 0);
hdr->lines = lines;
hdr->content->length = loc - hdr->content->offset;
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)
- || (ctx->magic == M_MMDF && str_cmp (MMDF_SEP, buffer) == 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 (ctx->magic == M_MBOX)
/* 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_MMDF && str_cmp (MMDF_SEP, buf) != 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));
i = -1;
fgets (tmp, sizeof (tmp), f);
if (str_ncmp ("From ", tmp, 5) == 0)
magic = M_MBOX;
- else if (str_cmp (MMDF_SEP, tmp) == 0)
+ else if (m_strcmp(MMDF_SEP, tmp) == 0)
magic = M_MMDF;
safe_fclose (&f);
#ifndef BUFFY_SIZE
if (!(t = strtok (buff, " \t:")))
continue;
- if (!str_cmp (t, MhUnseen))
+ if (!m_strcmp(t, MhUnseen))
f = MH_SEQ_UNSEEN;
- else if (!str_cmp (t, MhFlagged))
+ else if (!m_strcmp(t, MhFlagged))
f = MH_SEQ_FLAGGED;
- else if (!str_cmp (t, MhReplied))
+ else if (!m_strcmp(t, MhReplied))
f = MH_SEQ_REPLIED;
else /* unknown sequence */
continue;
if (subdir) {
snprintf (buf, sizeof (buf), "%s/%s", ctx->path, subdir);
- is_old = (str_cmp ("cur", subdir) == 0);
+ is_old = (m_strcmp("cur", subdir) == 0);
}
else
strfcpy (buf, ctx->path, sizeof (buf));
snprintf (fullpath, sizeof (fullpath), "%s/%s", ctx->path, partpath);
snprintf (oldpath, sizeof (oldpath), "%s/%s", ctx->path, h->path);
- if (str_cmp (fullpath, oldpath) == 0) {
+ if (m_strcmp(fullpath, oldpath) == 0) {
/* message hasn't really changed */
return 0;
}
/* check to see if the message has moved to a different
* subdirectory. If so, update the associated filename.
*/
- if (str_cmp (ctx->hdrs[i]->path, p->h->path))
+ if (m_strcmp(ctx->hdrs[i]->path, p->h->path))
str_replace (&ctx->hdrs[i]->path, p->h->path);
/* if the user hasn't modified the flags on this message, update
while ((de = readdir (dp))) {
maildir_canon_filename (tunique, de->d_name, sizeof (tunique));
- if (!str_cmp (tunique, unique)) {
+ if (!m_strcmp(tunique, unique)) {
snprintf (fname, sizeof (fname), "%s/%s/%s", folder, subfolder,
de->d_name);
fp = fopen (fname, "r"); /* __FOPEN_CHECKED__ */
if (regexec (&preg, linestr, 3, pmatch, 0) == 0) {
linestr[pmatch[1].rm_eo] = '\0';
linestr[pmatch[2].rm_eo] = '\0';
- if (str_cmp (linestr + pmatch[1].rm_so, hostname) == 0 &&
- str_cmp (linestr + pmatch[2].rm_so, buf) == 0) {
+ if (m_strcmp(linestr + pmatch[1].rm_so, hostname) == 0 &&
+ m_strcmp(linestr + pmatch[2].rm_so, buf) == 0) {
regfree (&preg);
p_delete(&linestr);
fclose (fp);
if (magic > 0 && !mx_access (s, W_OK)) {
if (option (OPTCONFIRMAPPEND) &&
- (!TrashPath || (str_cmp (s, TrashPath) != 0))) {
+ (!TrashPath || (m_strcmp(s, TrashPath) != 0))) {
/* if we're appending to the trash, there's no point in asking */
snprintf (tmp, sizeof (tmp), _("Append messages to %s?"), s);
if ((rc = mutt_yesorno (tmp, M_YES)) == M_NO)
int mutt_cmp_addr (const ADDRESS * a, const ADDRESS * b)
{
while (a && b) {
- if (str_cmp (a->mailbox, b->mailbox) ||
- str_cmp (a->personal, b->personal))
+ if (m_strcmp(a->mailbox, b->mailbox) ||
+ m_strcmp(a->personal, b->personal))
return (0);
a = a->next;
int mutt_cmp_list (const LIST * a, const LIST * b)
{
while (a && b) {
- if (str_cmp (a->data, b->data))
+ if (m_strcmp(a->data, b->data))
return (0);
a = a->next;
int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2)
{
if (e1 && e2) {
- if (str_cmp (e1->message_id, e2->message_id) ||
- str_cmp (e1->subject, e2->subject) ||
+ if (m_strcmp(e1->message_id, e2->message_id) ||
+ m_strcmp(e1->subject, e2->subject) ||
!mutt_cmp_list (e1->references, e2->references) ||
!mutt_cmp_addr (e1->from, e2->from) ||
!mutt_cmp_addr (e1->sender, e2->sender) ||
int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2)
{
while (p1 && p2) {
- if (str_cmp (p1->attribute, p2->attribute) ||
- str_cmp (p1->value, p2->value))
+ if (m_strcmp(p1->attribute, p2->attribute) ||
+ m_strcmp(p1->value, p2->value))
return (0);
p1 = p1->next;
{
if (b1->type != b2->type ||
b1->encoding != b2->encoding ||
- str_cmp (b1->subtype, b2->subtype) ||
- str_cmp (b1->description, b2->description) ||
+ m_strcmp(b1->subtype, b2->subtype) ||
+ m_strcmp(b1->description, b2->description) ||
!mutt_cmp_param (b1->parameter, b2->parameter) ||
b1->length != b2->length)
return (0);
#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
#define MX_IDX(idx) (idx >= 0 && idx < MailboxFormats->length)
-#define mutt_is_spool(s) (str_cmp (Spoolfile, s) == 0)
+#define mutt_is_spool(s) (m_strcmp(Spoolfile, s) == 0)
#ifdef USE_DOTLOCK
/* parameters:
if (!*cp)
continue;
cp[0] = 0;
- if (!str_cmp (buf, "#:"))
+ if (!m_strcmp(buf, "#:"))
break;
sscanf (cp + 1, "%s %d %d", file, &l, &m);
- if (!str_cmp (buf, "ALL")) {
+ if (!m_strcmp(buf, "ALL")) {
news->cache = m_strdup(file);
news->newgroups_time = m;
}
NNTP_DATA *data = (NNTP_DATA *) list->data;
if (data && data->subscribed && data->unread &&
Context && Context->magic == M_NNTP &&
- str_cmp (data->group, ((NNTP_DATA *) Context->data)->group) == 0) {
+ m_strcmp(data->group, ((NNTP_DATA *) Context->data)->group) == 0) {
list = list->next;
break;
}
if (data && data->subscribed && data->unread) {
if (Context && Context->magic == M_NNTP &&
- !str_cmp (data->group, ((NNTP_DATA *) Context->data)->group)) {
+ !m_strcmp(data->group, ((NNTP_DATA *) Context->data)->group)) {
unsigned int i, unread = 0;
for (i = 0; i < Context->msgcount; i++)
*colon = '\0';
colon++;
nntp_get_status (ctx, h, b, atoi (colon));
- if (h && h->article_num == 0 && str_cmp (group, b) == 0)
+ if (h && h->article_num == 0 && m_strcmp(group, b) == 0)
h->article_num = atoi (colon);
}
}
d++;
debug_print (2, ("group: %s, desc: %s\n", line, d));
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, line)) != NULL &&
- str_cmp (d, data->desc)) {
+ m_strcmp(d, data->desc)) {
p_delete(&data->desc);
data->desc = m_strdup(d);
}
else if (check_attachment_marker ((char *) raw) == 0)
lineInfo[n].type = MT_COLOR_ATTACHMENT;
#endif
- else if (str_cmp ("-- \n", buf) == 0
- || str_cmp ("-- \r\n", buf) == 0) {
+ else if (m_strcmp("-- \n", buf) == 0
+ || m_strcmp("-- \r\n", buf) == 0) {
i = n + 1;
lineInfo[n].type = MT_COLOR_SIGNATURE;
buffer[i] = 0;
/* Check for the end boundary */
- if (str_cmp (buffer + blen + 2, "--") == 0) {
+ if (m_strcmp(buffer + blen + 2, "--") == 0) {
final = 1;
break; /* done parsing */
}
if (!strchr (s, '~') && !strchr (s, '=')) { /* yup, so spoof a real request */
/* convert old tokens into the new format */
- if (ascii_strcasecmp ("all", s) == 0 || !str_cmp ("^", s) || !str_cmp (".", s)) /* ~A is more efficient */
+ if (ascii_strcasecmp ("all", s) == 0 || !m_strcmp("^", s) || !m_strcmp(".", s)) /* ~A is more efficient */
strfcpy (s, "~A", len);
else if (ascii_strcasecmp ("del", s) == 0)
strfcpy (s, "~D", len);
strfcpy (temp, buf, sizeof (temp));
mutt_check_simple (temp, sizeof (temp), NONULL (SimpleSearch));
- if (!SearchPattern || str_cmp (temp, LastSearchExpn)) {
+ if (!SearchPattern || m_strcmp(temp, LastSearchExpn)) {
set_option (OPTSEARCHINVALID);
strfcpy (LastSearch, buf, sizeof (LastSearch));
mutt_message _("Compiling search pattern...");
continue;
}
- if (str_cmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0)
+ if (m_strcmp(buf, "-----BEGIN PGP SIGNATURE-----\n") == 0)
break;
if (armor_header) {
clearsign = 0;
start_pos = last_pos;
- if (str_cmp ("MESSAGE-----\n", buf + 15) == 0)
+ if (m_strcmp("MESSAGE-----\n", buf + 15) == 0)
needpass = 1;
- else if (str_cmp ("SIGNED MESSAGE-----\n", buf + 15) == 0) {
+ else if (m_strcmp("SIGNED MESSAGE-----\n", buf + 15) == 0) {
clearsign = 1;
needpass = 0;
}
else if (!option (OPTDONTHANDLEPGPKEYS) &&
- str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) {
+ m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) {
needpass = 0;
pgp_keyblock = 1;
}
fputs (buf, tmpfp);
if ((needpass
- && str_cmp ("-----END PGP MESSAGE-----\n", buf) == 0)
+ && m_strcmp("-----END PGP MESSAGE-----\n", buf) == 0)
|| (!needpass
- && (str_cmp ("-----END PGP SIGNATURE-----\n", buf) == 0
- || str_cmp ("-----END PGP PUBLIC KEY BLOCK-----\n",
+ && (m_strcmp("-----END PGP SIGNATURE-----\n", buf) == 0
+ || m_strcmp("-----END PGP PUBLIC KEY BLOCK-----\n",
buf) == 0)))
break;
}
while (fgets (buf, sizeof (buf), tfp)) {
if (str_ncmp ("-----BEGIN PGP ", buf, 15) == 0) {
- if (str_cmp ("MESSAGE-----\n", buf + 15) == 0)
+ if (m_strcmp("MESSAGE-----\n", buf + 15) == 0)
enc = 1;
- else if (str_cmp ("SIGNED MESSAGE-----\n", buf + 15) == 0)
+ else if (m_strcmp("SIGNED MESSAGE-----\n", buf + 15) == 0)
sgn = 1;
- else if (str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0)
+ else if (m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15) == 0)
key = 1;
}
}
* recommended for future releases of PGP.
*/
while (fgets (buffer, sizeof (buffer) - 1, pgpout) != NULL) {
- if (str_cmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0)
+ if (m_strcmp("-----BEGIN PGP MESSAGE-----\n", buffer) == 0)
fputs ("-----BEGIN PGP SIGNATURE-----\n", fp);
- else if (str_cmp ("-----END PGP MESSAGE-----\n", buffer) == 0)
+ else if (m_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0)
fputs ("-----END PGP SIGNATURE-----\n", fp);
else
fputs (buffer, fp);
sscanf (line, "%d %s", &index, line);
for (i = 0; i < ctx->msgcount; i++)
- if (!str_cmp (line, ctx->hdrs[i]->data))
+ if (!m_strcmp(line, ctx->hdrs[i]->data))
break;
if (i == ctx->msgcount) {
sscanf (line, "%u %s", &index, line);
for (i = 0; i < ctx->msgcount; i++) {
- if (!str_cmp (ctx->hdrs[i]->data, line)) {
+ if (!m_strcmp(ctx->hdrs[i]->data, line)) {
ctx->hdrs[i]->refno = index;
break;
}
}
if (idx[x]->tree) {
- if (str_cmp (idx[x]->tree, buf) != 0)
+ if (m_strcmp(idx[x]->tree, buf) != 0)
str_replace (&idx[x]->tree, buf);
}
else
if (chain->cl >= MAXMIXES)
return -1;
- if (!str_cmp (s, "0") || !ascii_strcasecmp (s, "<random>")) {
+ if (!m_strcmp(s, "0") || !ascii_strcasecmp (s, "<random>")) {
chain->ch[chain->cl++] = 0;
return 0;
}
/* check type */
ch = get_field (buf);
if (ascii_strcasecmp (buf, type) && (ascii_strncasecmp (buf, type, btlen) || (buf[btlen] != 0 && /* implicit wild */
- str_cmp (buf + btlen, "/*")))) /* wildsubtype */
+ m_strcmp(buf + btlen, "/*")))) /* wildsubtype */
continue;
/* next field is the viewcommand */
q = p;
p = p->next;
- c = str_cmp (par->value, q->value);
+ c = m_strcmp(par->value, q->value);
if ((c > 0) || (c == 0 && par->index >= q->index))
break;
}
rfc2231_free_parameter (&par);
if ((par = q))
valp = par->value;
- } while (par && !str_cmp (par->attribute, attribute));
+ } while (par && !m_strcmp(par->attribute, attribute));
if (value) {
if (encoded)
/* look for an existing entry and update the value, else add it to the end
of the list */
for (ptr = Score, last = NULL; ptr; last = ptr, ptr = ptr->next)
- if (str_cmp (pattern, ptr->str) == 0)
+ if (m_strcmp(pattern, ptr->str) == 0)
break;
if (!ptr) {
if ((pat = mutt_pattern_comp (pattern, 0, err)) == NULL) {
while (MoreArgs (s)) {
mutt_extract_token (buf, s, 0);
- if (!str_cmp ("*", buf->data)) {
+ if (!m_strcmp("*", buf->data)) {
for (tmp = Score; tmp;) {
last = tmp;
tmp = tmp->next;
}
else {
for (tmp = Score; tmp; last = tmp, tmp = tmp->next) {
- if (!str_cmp (buf->data, tmp->str)) {
+ if (!m_strcmp(buf->data, tmp->str)) {
if (last)
last->next = tmp->next;
else
if (option (OPTSIGONTOP)
&& (!(flags & (SENDMAILX | SENDKEY)) && Editor
- && str_cmp (Editor, "builtin") != 0))
+ && m_strcmp(Editor, "builtin") != 0))
append_signature (tempfp);
/* include replies/forwarded messages, unless we are given a template */
if (!option (OPTSIGONTOP)
&& (!(flags & (SENDMAILX | SENDKEY)) && Editor
- && str_cmp (Editor, "builtin") != 0))
+ && m_strcmp(Editor, "builtin") != 0))
append_signature (tempfp);
/*
if (mutt_needs_mailcap (msg->content)) {
if (!mutt_edit_attachment (msg->content))
goto cleanup;
- } else if (!Editor || str_cmp ("builtin", Editor) == 0)
+ } else if (!Editor || m_strcmp("builtin", Editor) == 0)
mutt_builtin_editor (msg->content->filename, msg, cur);
else if (option (OPTEDITHDRS)) {
mutt_env_to_local (msg->env);
fcc[0] = '\0';
#endif
- if (*fcc && str_cmp ("/dev/null", fcc) != 0) {
+ if (*fcc && m_strcmp("/dev/null", fcc) != 0) {
BODY *tmpbody = msg->content;
BODY *save_sig = NULL;
BODY *save_parts = NULL;
/* check to see if the user wants copies of all attachments */
if (!option (OPTFCCATTACH) && msg->content->type == TYPEMULTIPART) {
if (WithCrypto
- && (str_cmp (msg->content->subtype, "encrypted") == 0 ||
- str_cmp (msg->content->subtype, "signed") == 0)) {
+ && (m_strcmp(msg->content->subtype, "encrypted") == 0 ||
+ m_strcmp(msg->content->subtype, "signed") == 0)) {
if (clear_content->type == TYPEMULTIPART) {
if (!(msg->security & ENCRYPT) && (msg->security & SIGN)) {
/* save initial signature and attachments */
/* This is pretty gross, but it's the best solution for now... */
if ((WithCrypto & APPLICATION_PGP)
&& a->type == TYPEAPPLICATION
- && str_cmp (a->subtype, "pgp-encrypted") == 0) {
+ && m_strcmp(a->subtype, "pgp-encrypted") == 0) {
fputs ("Version: 1\n", f);
return 0;
}
move (i, SidebarWidth - delim_len);
if (option (OPTASCIICHARS))
addstr (NONULL (SidebarDelim));
- else if (!option (OPTASCIICHARS) && !str_cmp (SidebarDelim, "|"))
+ else if (!option (OPTASCIICHARS) && !m_strcmp(SidebarDelim, "|"))
addch (ACS_VLINE);
- else if ((Charset_is_utf8) && !str_cmp (SidebarDelim, "|"))
+ else if ((Charset_is_utf8) && !m_strcmp(SidebarDelim, "|"))
addstr ("\342\224\202");
else
addstr (NONULL (SidebarDelim));
/* If either aptr or bptr is equal to data, there is no numeric */
/* value for that spam attribute. In this case, compare lexically. */
if ((aptr == (*ppa)->env->spam->data) || (bptr == (*ppb)->env->spam->data))
- return (SORTCODE (str_cmp (aptr, bptr)));
+ return (SORTCODE (m_strcmp(aptr, bptr)));
/* Otherwise, we have numeric value for both attrs. If these values */
/* are equal, then we first fall back upon string comparison, then */
/* upon auxiliary sort. */
if (result == 0) {
- result = str_cmp (aptr, bptr);
+ result = m_strcmp(aptr, bptr);
if (result == 0)
AUXSORT (result, a, b);
}
void state_mark_attach (STATE * s)
{
- if ((s->flags & M_DISPLAY) && !str_cmp (Pager, "builtin"))
+ if ((s->flags & M_DISPLAY) && !m_strcmp(Pager, "builtin"))
state_puts (AttachmentMarker, s);
}
((env->real_subj != env->subject) || (!option (OPTSORTRE)))) {
for (curlist = subjects, oldlist = NULL;
curlist; oldlist = curlist, curlist = curlist->next) {
- rc = str_cmp (env->real_subj, curlist->data);
+ rc = m_strcmp(env->real_subj, curlist->data);
if (rc >= 0)
break;
}
(last->message->received < tmp->message->received) :
(last->message->date_sent < tmp->message->date_sent))) &&
tmp->message->env->real_subj &&
- str_cmp (subjects->data, tmp->message->env->real_subj) == 0)
+ m_strcmp(subjects->data, tmp->message->env->real_subj) == 0)
last = tmp; /* best match so far */
}
* parent, since otherwise they rightly belong to the message
* we're attaching. */
if (tmp == cur
- || !str_cmp (tmp->message->env->real_subj,
+ || !m_strcmp(tmp->message->env->real_subj,
parent->message->env->real_subj)) {
tmp->message->subject_changed = 0;
if (!tmp)
cur->subject_changed = 1;
else if (cur->env->real_subj && tmp->message->env->real_subj)
- cur->subject_changed = str_cmp (cur->env->real_subj,
+ cur->subject_changed = m_strcmp(cur->env->real_subj,
tmp->message->env->
real_subj) ? 1 : 0;
else
if (!cur->env->references)
ref = ref->next;
else {
- if (str_cmp (ref->data, cur->env->references->data))
+ if (m_strcmp(ref->data, cur->env->references->data))
ref = cur->env->references;
else
ref = cur->env->references->next;