{
init_state(&state, NULL);
state.imap_browse = true;
- if (!imap_browse(f, &state))
+ if (imap_browse(f, &state) == 0)
{
mutt_str_strfcpy(LastDir, state.folder, sizeof(LastDir));
browser_sort(&state);
break;
}
- if (!imap_mailbox_create(LastDir))
+ if (imap_mailbox_create(LastDir) == 0)
{
/* TODO: find a way to detect if the new folder would appear in
* this window, and insert it without starting over. */
snprintf(msg, sizeof(msg), _("Really delete mailbox \"%s\"?"), mx.mbox);
if (mutt_yesorno(msg, MUTT_NO) == MUTT_YES)
{
- if (!imap_delete_mailbox(Context, &mx))
+ if (imap_delete_mailbox(Context, &mx) == 0)
{
/* free the mailbox from the browser */
FREE(&((state.entry)[nentry].name));
*o = MT_COLOR_QUOTED;
}
- else if (!mutt_str_strcasecmp(buf->data, "compose"))
+ else if (mutt_str_strcasecmp(buf->data, "compose") == 0)
{
if (!MoreArgs(s))
{
{
if (cur->security & GOODSIGN)
{
- if (!crypt_smime_verify_sender(cur))
+ if (crypt_smime_verify_sender(cur) == 0)
mutt_message(_("S/MIME signature successfully verified."));
else
mutt_error(_("S/MIME certificate owner does not match sender."));
#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETADDRINFO_A)
char node[STRING];
- if (gethostname(node, sizeof(node)))
+ if (gethostname(node, sizeof(node)) != 0)
return rc;
struct addrinfo hints;
buf[0] = 0;
if (pos == 0 && SslVerifyHost != MUTT_NO)
{
- if (!check_host(cert, host, buf, sizeof(buf)))
+ if (check_host(cert, host, buf, sizeof(buf)) == 0)
{
mutt_error(_("Certificate host check failed: %s"), buf);
/* we disallow (a)ccept always in the prompt, because it will have no effect
gnutls_datum_t pemdata;
int row, done, ret;
- if (!tls_check_preauth(certdata, certstat, hostname, idx, &certerr, &savedcert))
+ if (tls_check_preauth(certdata, certstat, hostname, idx, &certerr, &savedcert) == 0)
return 1;
/* skip signers if insecure algorithm was used */
goto fail;
}
- if (!tls_check_certificate(conn))
+ if (tls_check_certificate(conn) == 0)
goto fail;
/* set Security Strength Factor (SSF) for SASL */
{
if (flags & CH_DECODE)
{
- if (!address_header_decode(&this_one))
+ if (address_header_decode(&this_one) == 0)
mutt_rfc2047_decode(&this_one);
this_one_len = mutt_str_strlen(this_one);
{
if (flags & CH_DECODE)
{
- if (!address_header_decode(&this_one))
+ if (address_header_decode(&this_one) == 0)
mutt_rfc2047_decode(&this_one);
this_one_len = mutt_str_strlen(this_one);
}
rc = 1;
goto bye;
}
- if (!mutt_complete(buf, buflen))
+ if (mutt_complete(buf, buflen) == 0)
{
templen = state->lastchar - i;
mutt_mem_realloc(&tempbuf, templen * sizeof(wchar_t));
goto bye;
}
- if (!mutt_complete(buf, buflen))
+ if (mutt_complete(buf, buflen) == 0)
{
templen = state->lastchar;
mutt_mem_realloc(&tempbuf, templen * sizeof(wchar_t));
source = dest = 0;
while (source < h->last)
{
- if (!mutt_str_strcmp(h->hist[source], str))
+ if (mutt_str_strcmp(h->hist[source], str) == 0)
FREE(&h->hist[source++]);
else
h->hist[dest++] = h->hist[source++];
source = dest = History;
while (source > old_last)
{
- if (!mutt_str_strcmp(h->hist[source], str))
+ if (mutt_str_strcmp(h->hist[source], str) == 0)
FREE(&h->hist[source--]);
else
h->hist[dest--] = h->hist[source--];
if (mutt_get_field(_("Create mailbox: "), buf, sizeof(buf), MUTT_FILE) < 0)
goto fail;
- if (!mutt_str_strlen(buf))
+ if (mutt_str_strlen(buf) == 0)
{
mutt_error(_("Mailbox must have a name."));
goto fail;
if (mutt_get_field(buf, newname, sizeof(newname), MUTT_FILE) < 0)
goto fail;
- if (!mutt_str_strlen(newname))
+ if (mutt_str_strlen(newname) == 0)
{
mutt_error(_("Mailbox must have a name."));
goto fail;
/* Name */
s = imap_next_word(s);
/* Notes often responds with literals here. We need a real tokenizer. */
- if (!imap_get_literal_count(s, &litlen))
+ if (imap_get_literal_count(s, &litlen) == 0)
{
if (imap_cmd_step(idata) != IMAP_CMD_CONTINUE)
{
mailbox = imap_next_word(s);
/* We need a real tokenizer. */
- if (!imap_get_literal_count(mailbox, &litlen))
+ if (imap_get_literal_count(mailbox, &litlen) == 0)
{
if (imap_cmd_step(idata) != IMAP_CMD_CONTINUE)
{
#include "conn/conn.h"
#include "mutt.h"
#include "imap.h"
+#include "auth.h"
#include "bcache.h"
#include "body.h"
#include "buffy.h"
*/
static int compile_search(struct Context *ctx, const struct Pattern *pat, struct Buffer *buf)
{
- if (!do_search(pat, 0))
+ if (do_search(pat, 0) == 0)
return 0;
if (pat->not)
imap_open_connection(idata);
if (idata->state == IMAP_CONNECTED)
{
- if (!imap_authenticate(idata))
+ if (imap_authenticate(idata) == IMAP_AUTH_SUCCESS)
{
idata->state = IMAP_AUTHENTICATED;
FREE(&idata->capstr);
for (int i = 0; i < ctx->msgcount; i++)
ctx->hdrs[i]->matched = false;
- if (!do_search(pat, 1))
+ if (do_search(pat, 1) == 0)
return 0;
mutt_buffer_init(&buf);
}
/* check that the save-to folder is in the same account */
- if (!mutt_account_match(&(idata->conn->account), &(mx.account)))
+ if (mutt_account_match(&(idata->conn->account), &(mx.account)) == 0)
{
mutt_debug(3, "%s not same server as %s\n", dest, ctx->path);
return 1;
}
/* check that the save-to folder is in the same account */
- if (!mutt_account_match(&(idata->conn->account), &(mx.account)))
+ if (mutt_account_match(&(idata->conn->account), &(mx.account)) == 0)
{
mutt_debug(3, "%s not same server as %s\n", dest, ctx->path);
return 1;
{
if (flags & MUTT_BUFFY)
{
- if (!mutt_buffy_check(false))
+ if (mutt_buffy_check(false) == 0)
{
mutt_message(_("No mailbox with new mail."));
goto main_curses; // TEST37: neomutt -Z (no new mail)
if (icode)
while ((t < (u + ulen)) && CONTINUATION_BYTE(*t))
t++;
- if (!try_block(t0, t - t0, icode, tocode, &encoder, &wlen) &&
+ if ((try_block(t0, t - t0, icode, tocode, &encoder, &wlen) == 0) &&
((col + (t0 - u) + wlen) <= (ENCWORD_LEN_MAX + 1)))
{
break;
if (icode)
while (CONTINUATION_BYTE(*t))
t--;
- if (!try_block(t, t1 - t, icode, tocode, &encoder, &wlen) &&
+ if ((try_block(t, t1 - t, icode, tocode, &encoder, &wlen) == 0) &&
((1 + wlen + (u + ulen - t1)) <= (ENCWORD_LEN_MAX + 1)))
{
break;
#ifdef USE_IMAP
if (Context->magic == MUTT_IMAP && mx_is_imap(Trash))
{
- if (!imap_fast_trash(Context, Trash))
+ if (imap_fast_trash(Context, Trash) == 0)
return 0;
}
#endif
return -1;
}
}
- else if (!mutt_str_strcasecmp("flowed", mutt_param_get(&msg->content->parameter, "format")))
+ else if (mutt_str_strcasecmp("flowed", mutt_param_get(&msg->content->parameter, "format")) == 0)
{
if ((query_quadoption(PgpMimeAuto,
_("Inline PGP can't be used with format=flowed. "
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
{
- if (!mutt_is_multipart_encrypted(b))
+ if (mutt_is_multipart_encrypted(b) == 0)
return 0;
b = b->parts;
use_smime ? "application/pkcs7-signature" : "application/pgp-signature");
/* Get the micalg from gpgme. Old gpgme versions don't support this
for S/MIME so we assume sha-1 in this case. */
- if (!get_micalg(ctx, use_smime, buf, sizeof(buf)))
+ if (get_micalg(ctx, use_smime, buf, sizeof(buf)) == 0)
mutt_param_set(&t->parameter, "micalg", buf);
else if (use_smime)
mutt_param_set(&t->parameter, "micalg", "sha1");
size_t saved_b_length;
int saved_b_type;
- if (!mutt_is_application_smime(b))
+ if (mutt_is_application_smime(b) == 0)
return -1;
if (b->parts)
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, mutt_buffy_check(false));
}
- else if (!mutt_buffy_check(false))
+ else if (mutt_buffy_check(false) == 0)
optional = 0;
break;
* in reverse order so they're forwards
*/
Sort ^= SORT_REVERSE;
- if (!compare_threads(NULL, NULL))
+ if (compare_threads(NULL, NULL) == 0)
return thread;
top = thread;