#ifdef HAVE_COLOR
if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
return attr | mutt_color_alloc(c, fg, bg);
- else
#endif
- return attr;
+ return attr;
}
/**
}
}
- /* append bptr to the alts list,
- * and remove from the e->content list */
- if (!alts)
+ // append bptr to the alts list, and remove from the e->content list
+ if (alts)
{
- group->parts = bptr;
- alts = bptr;
+ alts->next = bptr;
bptr = bptr->next;
+ alts = alts->next;
alts->next = NULL;
}
else
{
- alts->next = bptr;
+ group->parts = bptr;
+ alts = bptr;
bptr = bptr->next;
- alts = alts->next;
alts->next = NULL;
}
}
}
- /* append bptr to the alts list,
- * and remove from the e->content list */
- if (!alts)
+ // append bptr to the alts list, and remove from the e->content list
+ if (alts)
{
- group->parts = bptr;
- alts = bptr;
+ alts->next = bptr;
bptr = bptr->next;
+ alts = alts->next;
alts->next = NULL;
}
else
{
- alts->next = bptr;
+ group->parts = bptr;
+ alts = bptr;
bptr = bptr->next;
- alts = alts->next;
alts->next = NULL;
}
if (find_hook(MUTT_OPEN_HOOK, path))
return true;
- else
- return false;
+
+ return false;
}
/**
cmp1 = certname + 2;
cmp2 = strchr(hostname, '.');
if (!cmp2)
- {
return false;
- }
- else
- {
- cmp2++;
- }
+
+ cmp2++;
}
else
{
if (SSL_has_pending(data->ssl))
return 1;
- else
- return raw_socket_poll(conn, wait_secs);
+
+ return raw_socket_poll(conn, wait_secs);
}
/**
{
if (preauthrc == 0)
return 1;
- else
- break;
+ break;
}
}
if (gnutls_record_check_pending(data->state))
return 1;
- else
- return raw_socket_poll(conn, wait_secs);
+
+ return raw_socket_poll(conn, wait_secs);
}
/**
if (strncmp(l, ".pp", 3) == 0)
return print_it(SP_NEWPAR, NULL, out, docstat);
- else if (strncmp(l, ".ts", 3) == 0)
+ if (strncmp(l, ".ts", 3) == 0)
return print_it(SP_START_TAB, NULL, out, docstat);
- else if (strncmp(l, ".te", 3) == 0)
+ if (strncmp(l, ".te", 3) == 0)
return print_it(SP_END_TAB, NULL, out, docstat);
- else if (strncmp(l, ".dl", 3) == 0)
+ if (strncmp(l, ".dl", 3) == 0)
return print_it(SP_START_DL, NULL, out, docstat);
- else if (strncmp(l, ".de", 3) == 0)
+ if (strncmp(l, ".de", 3) == 0)
return print_it(SP_END_DL, NULL, out, docstat);
- else if (strncmp(l, ".il", 3) == 0)
+ if (strncmp(l, ".il", 3) == 0)
return print_it(SP_START_IL, NULL, out, docstat);
- else if (strncmp(l, ".ie", 3) == 0)
+ if (strncmp(l, ".ie", 3) == 0)
return print_it(SP_END_IL, NULL, out, docstat);
- else if (strncmp(l, ". ", 2) == 0)
+ if (strncmp(l, ". ", 2) == 0)
*l = ' ';
for (s = l, d = buf; *s; s++)
{
return false;
}
- else
- return true;
+ return true;
}
else
{
- if (!e1 && !e2)
- return true;
- else
- return false;
+ return (!e1 && !e2);
}
}
}
else
{
- if (!e1 && !e2)
- return true;
- else
- return false;
+ return (!e1 && !e2);
}
}
{
if (mutt_str_strcasecmp("text", s) == 0)
return TYPE_TEXT;
- else if (mutt_str_strcasecmp("multipart", s) == 0)
+ if (mutt_str_strcasecmp("multipart", s) == 0)
return TYPE_MULTIPART;
#ifdef SUN_ATTACHMENT
- else if (mutt_str_strcasecmp("x-sun-attachment", s) == 0)
+ if (mutt_str_strcasecmp("x-sun-attachment", s) == 0)
return TYPE_MULTIPART;
#endif
- else if (mutt_str_strcasecmp("application", s) == 0)
+ if (mutt_str_strcasecmp("application", s) == 0)
return TYPE_APPLICATION;
- else if (mutt_str_strcasecmp("message", s) == 0)
+ if (mutt_str_strcasecmp("message", s) == 0)
return TYPE_MESSAGE;
- else if (mutt_str_strcasecmp("image", s) == 0)
+ if (mutt_str_strcasecmp("image", s) == 0)
return TYPE_IMAGE;
- else if (mutt_str_strcasecmp("audio", s) == 0)
+ if (mutt_str_strcasecmp("audio", s) == 0)
return TYPE_AUDIO;
- else if (mutt_str_strcasecmp("video", s) == 0)
+ if (mutt_str_strcasecmp("video", s) == 0)
return TYPE_VIDEO;
- else if (mutt_str_strcasecmp("model", s) == 0)
+ if (mutt_str_strcasecmp("model", s) == 0)
return TYPE_MODEL;
- else if (mutt_str_strcasecmp("*", s) == 0)
+ if (mutt_str_strcasecmp("*", s) == 0)
return TYPE_ANY;
- else if (mutt_str_strcasecmp(".*", s) == 0)
+ if (mutt_str_strcasecmp(".*", s) == 0)
return TYPE_ANY;
- else
- return TYPE_OTHER;
+
+ return TYPE_OTHER;
}
/**
{
if (mutt_str_startswith(c, "7bit", CASE_IGNORE))
return ENC_7BIT;
- else if (mutt_str_startswith(c, "8bit", CASE_IGNORE))
+ if (mutt_str_startswith(c, "8bit", CASE_IGNORE))
return ENC_8BIT;
- else if (mutt_str_startswith(c, "binary", CASE_IGNORE))
+ if (mutt_str_startswith(c, "binary", CASE_IGNORE))
return ENC_BINARY;
- else if (mutt_str_startswith(c, "quoted-printable", CASE_IGNORE))
+ if (mutt_str_startswith(c, "quoted-printable", CASE_IGNORE))
return ENC_QUOTED_PRINTABLE;
- else if (mutt_str_startswith(c, "base64", CASE_IGNORE))
+ if (mutt_str_startswith(c, "base64", CASE_IGNORE))
return ENC_BASE64;
- else if (mutt_str_startswith(c, "x-uuencode", CASE_IGNORE))
+ if (mutt_str_startswith(c, "x-uuencode", CASE_IGNORE))
return ENC_UUENCODED;
#ifdef SUN_ATTACHMENT
- else if (mutt_str_startswith(c, "uuencode", CASE_IGNORE))
+ if (mutt_str_startswith(c, "uuencode", CASE_IGNORE))
return ENC_UUENCODED;
#endif
- else
- return ENC_OTHER;
+ return ENC_OTHER;
}
/**
char *u = strchr(t + 1, '\'');
if (u)
return u + 1;
- else
- return t + 1;
+ return t + 1;
}
/**
i = mutt_map_get_value(sbuf, UrlMap);
if (i == -1)
return U_UNKNOWN;
- else
- return (enum UrlScheme) i;
+
+ return (enum UrlScheme) i;
}
/**
{
if (is_autoview(a))
return true;
- else if (a->type == TYPE_TEXT)
+ if (a->type == TYPE_TEXT)
return true;
- else if (a->type == TYPE_MESSAGE)
+ if (a->type == TYPE_MESSAGE)
return true;
- else if (a->type == TYPE_MULTIPART)
+ if (a->type == TYPE_MULTIPART)
{
if (WithCrypto)
{
tcbdbtune(db, 0, 0, 0, -1, -1, BDBTDEFLATE);
if (tcbdbopen(db, path, BDBOWRITER | BDBOCREAT))
return db;
- else
- {
- int ecode = tcbdbecode(db);
- mutt_debug(LL_DEBUG2, "tcbdbopen failed for %s: %s (ecode %d)\n", path,
- tcbdberrmsg(ecode), ecode);
- tcbdbdel(db);
- return NULL;
- }
+
+ int ecode = tcbdbecode(db);
+ mutt_debug(LL_DEBUG2, "tcbdbopen failed for %s: %s (ecode %d)\n", path,
+ tcbdberrmsg(ecode), ecode);
+ tcbdbdel(db);
+ return NULL;
}
/**
if (rc == IMAP_RES_NO)
return IMAP_EXEC_ERROR;
- else if (rc != IMAP_RES_OK)
+ if (rc != IMAP_RES_OK)
{
if (adata->status != IMAP_FATAL)
return IMAP_EXEC_ERROR;
{
if (imap_path_status(path, false) >= 0)
return 0;
- else
- return -1;
+ return -1;
}
/**
{
if (imap_edata_get(e)->parsed)
return 0;
- else
- goto parsemsg;
+ goto parsemsg;
}
/* This function is called in a few places after endwin()
{
if (!Context->mailbox->emails[Context->mailbox->v2r[i]]->old)
return i;
- else if (old == -1)
+ if (old == -1)
old = i;
}
}
if (*t != '>')
return -1;
- else
- return n;
+ return n;
}
/**
{
if (!mhs->flags || (i > mhs->max))
return 0;
- else
- return mhs->flags[i];
+ return mhs->flags[i];
}
/**
{
if (left)
return left;
- else
- return right;
+ return right;
}
tail = head;
struct HashElem *he = union_hash_find_elem(table, key);
if (he)
return he->data;
- else
- return NULL;
+ return NULL;
}
/**
clen = mutt_mb_charlen(name, NULL);
if (clen < 1)
return false;
- else if ((clen == 1) && (isspace(*name) || (*name == '-')))
+ if ((clen == 1) && (isspace(*name) || (*name == '-')))
break;
}
const char *p = strrchr(f, '/');
if (p)
return p + 1;
- else
- return f;
+ return f;
}
/**
{
if (a)
return 1;
- else
- return 0;
+ return 0;
}
char tmp[128] = { 0 };
if (account->flags & MUTT_ACCT_LOGIN)
return 0;
#ifdef USE_IMAP
- else if (account->type == MUTT_ACCT_TYPE_IMAP)
+ if (account->type == MUTT_ACCT_TYPE_IMAP)
{
if (C_ImapLogin)
{
{
if (e->subject_changed)
return true;
- else
- break;
+ break;
}
}
{
if (is_visible(e, ctx))
return false;
- else if (e->subject_changed)
+ if (e->subject_changed)
return true;
}
}
/* return value depends on action requested */
if (flag & (MUTT_THREAD_COLLAPSE | MUTT_THREAD_UNCOLLAPSE))
return final;
- else if (flag & MUTT_THREAD_UNREAD)
+ if (flag & MUTT_THREAD_UNREAD)
return (old_mail && new_mail) ? new_mail : (old_mail ? old_mail : new_mail);
- else if (flag & MUTT_THREAD_GET_HIDDEN)
+ if (flag & MUTT_THREAD_GET_HIDDEN)
return num_hidden;
- else if (flag & MUTT_THREAD_NEXT_UNREAD)
+ if (flag & MUTT_THREAD_NEXT_UNREAD)
return min_unread;
- else if (flag & MUTT_THREAD_FLAGGED)
+ if (flag & MUTT_THREAD_FLAGGED)
return flagged;
}
/* return value depends on action requested */
if (flag & (MUTT_THREAD_COLLAPSE | MUTT_THREAD_UNCOLLAPSE))
return final;
- else if (flag & MUTT_THREAD_UNREAD)
+ if (flag & MUTT_THREAD_UNREAD)
return (old_mail && new_mail) ? new_mail : (old_mail ? old_mail : new_mail);
- else if (flag & MUTT_THREAD_GET_HIDDEN)
+ if (flag & MUTT_THREAD_GET_HIDDEN)
return num_hidden + 1;
- else if (flag & MUTT_THREAD_NEXT_UNREAD)
+ if (flag & MUTT_THREAD_NEXT_UNREAD)
return min_unread;
- else if (flag & MUTT_THREAD_FLAGGED)
+ if (flag & MUTT_THREAD_FLAGGED)
return flagged;
return 0;
{
if (wrap < 0)
return (width > -wrap) ? (width + wrap) : width;
- else if (wrap)
+ if (wrap)
return (wrap < width) ? wrap : width;
- else
- return width;
+ return width;
}
/**
query_quadoption(C_CatchupNewsgroup, _("Mark all articles read?"));
if (ans == MUTT_ABORT)
goto cleanup;
- else if (ans == MUTT_YES)
+ if (ans == MUTT_YES)
mutt_newsgroup_catchup(m, mdata->adata, mdata->group);
}
}
purge = query_quadoption(C_Delete, buf);
if (purge == MUTT_ABORT)
return -1;
- else if (purge == MUTT_NO)
+ if (purge == MUTT_NO)
{
if (!m->changed)
return 0; /* nothing to do! */
int rc = imap_path_status(path, false);
if (rc < 0)
return -1;
- else if (rc == 0)
+ if (rc == 0)
return 1;
- else
- return 0;
+ return 0;
}
#endif
default:
{
if (mutt_str_strcasecmp(t, "enveloped-data") == 0)
return SMIME_ENCRYPT;
- else if (mutt_str_strcasecmp(t, "signed-data") == 0)
+ if (mutt_str_strcasecmp(t, "signed-data") == 0)
return SMIME_SIGN | SMIME_OPAQUE;
- else
- return SEC_NO_FLAGS;
+ return SEC_NO_FLAGS;
}
/* Netscape 4.7 uses
* Content-Description: S/MIME Encrypted Message
r = strcmp(a_plvl, b_plvl);
if (!r)
return 0;
- else if (r > 0)
+ if (r > 0)
return positive;
- else
- return negative;
+ return negative;
}
- else if (*a_plvl == '.')
+ if (*a_plvl == '.')
return negative; /* B is larger. */
- else if (*b_plvl == '.')
+ if (*b_plvl == '.')
return positive; /* A is larger. */
- else if (*a_plvl != *b_plvl)
+ if (*a_plvl != *b_plvl)
break;
}
if (*a_plvl == *b_plvl)
return 0;
- else if ((*(signed char *) a_plvl - *(signed char *) b_plvl) > 0)
+ if ((*(signed char *) a_plvl - *(signed char *) b_plvl) > 0)
return positive;
- else
- return negative;
+ return negative;
}
#endif /* gpgme >= 1.9.0 */
{
if (flags & KEYFLAG_REVOKED)
return 'R';
- else if (flags & KEYFLAG_EXPIRED)
+ if (flags & KEYFLAG_EXPIRED)
return 'X';
- else if (flags & KEYFLAG_DISABLED)
+ if (flags & KEYFLAG_DISABLED)
return 'd';
- else if (flags & KEYFLAG_CRITICAL)
+ if (flags & KEYFLAG_CRITICAL)
return 'c';
- else
- return ' ';
+
+ return ' ';
}
/**
r = mutt_str_strcasecmp((*s)->uid, (*t)->uid);
if (r != 0)
return r > 0;
- else
- return mutt_str_strcasecmp(crypt_fpr_or_lkeyid(*s), crypt_fpr_or_lkeyid(*t)) > 0;
+ return mutt_str_strcasecmp(crypt_fpr_or_lkeyid(*s), crypt_fpr_or_lkeyid(*t)) > 0;
}
/**
r = mutt_str_strcasecmp(crypt_fpr_or_lkeyid(*s), crypt_fpr_or_lkeyid(*t));
if (r != 0)
return r > 0;
- else
- return mutt_str_strcasecmp((*s)->uid, (*t)->uid) > 0;
+ return mutt_str_strcasecmp((*s)->uid, (*t)->uid) > 0;
}
/**
{
if (C_PgpLongIds)
return k->keyid;
- else
- return k->keyid + 8;
+ return k->keyid + 8;
}
/**
{
if (flags & KEYFLAG_REVOKED)
return 'R';
- else if (flags & KEYFLAG_EXPIRED)
+ if (flags & KEYFLAG_EXPIRED)
return 'X';
- else if (flags & KEYFLAG_DISABLED)
+ if (flags & KEYFLAG_DISABLED)
return 'd';
- else if (flags & KEYFLAG_CRITICAL)
+ if (flags & KEYFLAG_CRITICAL)
return 'c';
- else
- return ' ';
+
+ return ' ';
}
/**
{
if (key->flags & KEYFLAG_SUBKEY && key->parent)
return key->parent;
- else
- return key;
+ return key;
}
/**
r = mutt_str_strcasecmp((*s)->addr, (*t)->addr);
if (r != 0)
- return r > 0;
- else
- {
- return mutt_str_strcasecmp(pgp_fpr_or_lkeyid((*s)->parent),
- pgp_fpr_or_lkeyid((*t)->parent)) > 0;
- }
+ return (r > 0);
+
+ return mutt_str_strcasecmp(pgp_fpr_or_lkeyid((*s)->parent),
+ pgp_fpr_or_lkeyid((*t)->parent)) > 0;
}
/**
r = mutt_str_strcasecmp(pgp_fpr_or_lkeyid((*s)->parent), pgp_fpr_or_lkeyid((*t)->parent));
if (r != 0)
- return r > 0;
- else
- return mutt_str_strcasecmp((*s)->addr, (*t)->addr) > 0;
+ return (r > 0);
+ return mutt_str_strcasecmp((*s)->addr, (*t)->addr) > 0;
}
/**
{
if (mutt_str_strcmp(str, "threads") == 0)
return NM_QUERY_TYPE_THREADS;
- else if (mutt_str_strcmp(str, "messages") == 0)
+ if (mutt_str_strcmp(str, "messages") == 0)
return NM_QUERY_TYPE_MESGS;
mutt_error(_("failed to parse notmuch query type: %s"), NONULL(str));
{
if (query_type == NM_QUERY_TYPE_THREADS)
return "threads";
- else
- return "messages";
+ return "messages";
}
/**
{
if (side == RANGE_S_LEFT)
return 1;
- else if (side == RANGE_S_RIGHT)
+ if (side == RANGE_S_RIGHT)
return Context->mailbox->msg_count;
}
/* We have something, so determine what */
{
if (pat->is_multi)
return (mutt_list_find(&pat->p.multi_cases, buf) != NULL);
- else if (pat->string_match)
+ if (pat->string_match)
return pat->ign_case ? strcasestr(buf, pat->p.str) : strstr(buf, pat->p.str);
- else if (pat->group_match)
+ if (pat->group_match)
return mutt_group_match(pat->p.group, buf);
- else
- return (regexec(pat->p.regex, buf, 0, NULL, 0) == 0);
+ return (regexec(pat->p.regex, buf, 0, NULL, 0) == 0);
}
/**
{
if (cur && !check_msg(cur, err))
return false;
- else if (!cur)
+ if (!cur)
{
for (short i = 0; i < actx->idxlen; i++)
{
"MIME-encapsulate the others?"));
if (ans == MUTT_ABORT)
return;
- else if (ans == MUTT_YES)
+ if (ans == MUTT_YES)
mime_reply_any = true;
}
else if (nattach == 1)
{
if (C_FastReply)
return 0;
- else
- mutt_str_strfcpy(buf, en->subject, sizeof(buf));
+ mutt_str_strfcpy(buf, en->subject, sizeof(buf));
}
else
{
{
if (a->encoding == ENC_BINARY)
return ENC_BINARY;
- else if (a->encoding == ENC_8BIT)
+ if (a->encoding == ENC_8BIT)
e = ENC_8BIT;
}
{
if (C_ReverseAlias && (ali = mutt_alias_reverse_lookup(a)) && ali->personal)
return ali->personal;
- else if (a->personal)
+ if (a->personal)
return a->personal;
- else if (a->mailbox)
+ if (a->mailbox)
return mutt_addr_for_display(a);
}
/* don't return NULL to avoid segfault when printing/comparing */