continue;
mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
- if ((rc = mutt_save_message_ctx(Context->hdrs[i], delete, decode, decrypt, &ctx) != 0))
+ rc = mutt_save_message_ctx(Context->hdrs[i], delete, decode, decrypt, &ctx);
+ if (rc != 0)
break;
#ifdef USE_COMPRESSED
if (cm)
mutt_str_strfcpy(buf, ENCODING(CURATTACH->content->encoding), sizeof(buf));
if (mutt_get_field("Content-Transfer-Encoding: ", buf, sizeof(buf), 0) == 0 && buf[0])
{
- if ((i = mutt_check_encoding(buf)) != ENCOTHER && i != ENCUUENCODED)
+ i = mutt_check_encoding(buf);
+ if ((i != ENCOTHER) && (i != ENCUUENCODED))
{
CURATTACH->content->encoding = i;
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
msg = mx_open_message(src, hdr->msgno);
if (!msg)
return -1;
- if ((r = mutt_copy_message_fp(fpout, msg->fp, hdr, flags, chflags)) == 0 &&
- (ferror(fpout) || feof(fpout)))
+ r = mutt_copy_message_fp(fpout, msg->fp, hdr, flags, chflags);
+ if ((r == 0) && (ferror(fpout) || feof(fpout)))
{
mutt_debug(1, "mutt_copy_message failed to detect EOF!\n");
r = -1;
if (option(OPT_DELETE_UNTAG))
mutt_thread_set_flag(CURHDR, MUTT_TAG, 0, subthread);
if (option(OPT_RESOLVE))
- if ((menu->current = ci_next_undeleted(menu->current)) == -1)
+ {
+ menu->current = ci_next_undeleted(menu->current);
+ if (menu->current == -1)
menu->current = menu->oldcurrent;
+ }
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
}
break;
{
if (option(OPT_RESOLVE))
{
- if ((menu->current = (op == OP_MAIN_READ_THREAD ?
- mutt_next_thread(CURHDR) :
- mutt_next_subthread(CURHDR))) == -1)
+ menu->current = (op == OP_MAIN_READ_THREAD ? mutt_next_thread(CURHDR) :
+ mutt_next_subthread(CURHDR));
+ if (menu->current == -1)
+ {
menu->current = menu->oldcurrent;
+ }
else if (menu->menu == MENU_PAGER)
{
op = OP_DISPLAY_MESSAGE;
char tmp[LONG_STRING], *p = NULL, *q = NULL;
int lng;
- if ((p = getenv("MM_NOASK")) != NULL && *p)
+ p = getenv("MM_NOASK");
+ if (p && *p)
{
if (mutt_str_strcmp(p, "1") == 0)
return 1;
if (!authenticator->method ||
(mutt_str_strcasecmp(authenticator->method, method) == 0))
{
- if ((r = authenticator->authenticate(idata, method)) != IMAP_AUTH_UNAVAIL)
+ r = authenticator->authenticate(idata, method);
+ if (r != IMAP_AUTH_UNAVAIL)
{
FREE(&methods);
return r;
while (authenticator->authenticate)
{
- if ((r = authenticator->authenticate(idata, NULL)) != IMAP_AUTH_UNAVAIL)
+ r = authenticator->authenticate(idata, NULL);
+ if (r != IMAP_AUTH_UNAVAIL)
return r;
authenticator++;
}
}
while (irc != IMAP_CMD_OK)
- if ((irc = imap_cmd_step(idata)) != IMAP_CMD_CONTINUE)
+ {
+ irc = imap_cmd_step(idata);
+ if (irc != IMAP_CMD_CONTINUE)
break;
+ }
if (rc != SASL_OK)
goto bail;
char *p = NULL;
mutt_extract_token(buf, s, MUTT_TOKEN_SPACE | MUTT_TOKEN_QUOTE);
- if ((p = strpbrk(buf->data, ": \t")) == NULL || *p != ':')
+ p = strpbrk(buf->data, ": \t");
+ if (!p || (*p != ':'))
{
mutt_str_strfcpy(err->data, _("invalid header field"), err->dsize);
return -1;
mutt_extract_token(buf, s, 0);
function = buf->data;
- if ((bindings = km_get_table(CurrentMenu)) == NULL && CurrentMenu != MENU_PAGER)
+ bindings = km_get_table(CurrentMenu);
+ if (!bindings && (CurrentMenu != MENU_PAGER))
bindings = OpGeneric;
ops[nops] = get_op(bindings, function, mutt_str_strlen(function));
}
/* Check to make sure that the file hasn't changed on disk */
- if ((i = mbox_check_mailbox(ctx, index_hint)) == MUTT_NEW_MAIL || i == MUTT_REOPENED)
+ i = mbox_check_mailbox(ctx, index_hint);
+ if ((i == MUTT_NEW_MAIL) || (i == MUTT_REOPENED))
{
/* new mail arrived, or mailbox reopened */
need_sort = i;
/* Create a temporary file to write the new version of the mailbox in. */
mutt_mktemp(tempfile, sizeof(tempfile));
- if ((i = open(tempfile, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1 ||
- (fp = fdopen(i, "w")) == NULL)
+ i = open(tempfile, O_WRONLY | O_EXCL | O_CREAT, 0600);
+ if ((i == -1) || (fp = fdopen(i, "w")) == NULL)
{
if (-1 != i)
{
h->read = false;
h->replied = false;
- if ((p = strrchr(path, ':')) != NULL && (mutt_str_strncmp(p + 1, "2,", 2) == 0))
+ p = strrchr(path, ':');
+ if (p && (mutt_str_strncmp(p + 1, "2,", 2) == 0))
{
p += 3;
/* create .mh_sequences when there isn't one. */
snprintf(buf, sizeof(buf), "%s/.mh_sequences", ctx->path);
- if ((i = stat(buf, &st_cur)) == -1 && errno == ENOENT)
+ i = stat(buf, &st_cur);
+ if ((i == -1) && (errno == ENOENT))
{
char *tmp = NULL;
FILE *fp = NULL;
/* First convert directly into the destination buffer */
memset(&st, 0, sizeof(st));
for (; slen && dlen >= MB_LEN_MAX; dest += k, dlen -= k, src++, slen--)
- if ((k = wcrtomb(dest, *src, &st)) == (size_t)(-1))
+ {
+ k = wcrtomb(dest, *src, &st);
+ if (k == (size_t)(-1))
break;
+ }
/* If this works, we can stop now */
if (dlen >= MB_LEN_MAX)
char *p = buf;
for (; slen && p - buf < dlen; p += k, src++, slen--)
- if ((k = wcrtomb(p, *src, &st)) == (size_t)(-1))
+ {
+ k = wcrtomb(p, *src, &st);
+ if (k == (size_t)(-1))
break;
+ }
p += wcrtomb(p, 0, &st);
/* If it fits into the destination buffer, we can stop now */
else if (strstr(p, "..") && (scheme == U_UNKNOWN || scheme == U_FILE) && realpath(p, tmp))
mutt_str_strfcpy(p, tmp, buflen - (p - s));
- if ((mutt_str_strncmp(s, Folder, (len = mutt_str_strlen(Folder))) == 0) && s[len] == '/')
+ len = mutt_str_strlen(Folder);
+ if ((mutt_str_strncmp(s, Folder, len) == 0) && s[len] == '/')
{
*s++ = '=';
memmove(s, s + len, mutt_str_strlen(s + len) + 1);
size_t l = 0;
FREE(&gpgcharset);
gpgcharset = mutt_str_strdup(buf + 9);
- if ((l = mutt_str_strlen(gpgcharset)) > 0 && gpgcharset[l - 1] == '\n')
+ l = mutt_str_strlen(gpgcharset);
+ if ((l > 0) && (gpgcharset[l - 1] == '\n'))
gpgcharset[l - 1] = 0;
if (!mutt_check_charset(gpgcharset, 0))
mutt_str_replace(&gpgcharset, "UTF-8");
size_t l;
const char *ps = NULL, *pl = NULL, *pfcopy = NULL, *phint = NULL;
- if ((l = mutt_str_strlen(p)) && p[l - 1] == '!')
+ l = mutt_str_strlen(p);
+ if ((l > 0) && (p[l - 1] == '!'))
p[l - 1] = 0;
mutt_message(_("Looking for keys matching \"%s\"..."), p);
/* don't consider line endings part of the buffer
* for regex matching */
- if ((nl = mutt_str_strlen(buf)) > 0 && buf[nl - 1] == '\n')
+ nl = mutt_str_strlen(buf);
+ if ((nl > 0) && (buf[nl - 1] == '\n'))
buf[nl - 1] = 0;
i = 0;
* it begins with a non-space */
/* check to see if the next line is a continuation line */
- if ((ch = fgetc(f)) != ' ' && ch != '\t')
+ ch = fgetc(f);
+ if ((ch != ' ') && (ch != '\t'))
{
ungetc(ch, f);
return line; /* next line is a separate header field or EOH */
line = mutt_read_rfc822_line(f, line, &linelen);
if (*line == '\0')
break;
- if ((p = strpbrk(line, ": \t")) == NULL || *p != ':')
+ p = strpbrk(line, ": \t");
+ if (!p || (*p != ':'))
{
char return_path[LONG_STRING];
time_t t;
{
if (pat->op == MUTT_HEADER)
{
- if (*(buf = mutt_read_rfc822_line(fp, buf, &blen)) == '\0')
+ buf = mutt_read_rfc822_line(fp, buf, &blen);
+ if (*buf == '\0')
break;
}
else if (fgets(buf, blen - 1, fp) == NULL)
}
if (SLtt_Screen_Rows <= 0)
{
- if ((cp = getenv("LINES")) != NULL && mutt_str_atoi(cp, &SLtt_Screen_Rows) < 0)
+ cp = getenv("LINES");
+ if (cp && (mutt_str_atoi(cp, &SLtt_Screen_Rows) < 0))
SLtt_Screen_Rows = 24;
}
if (SLtt_Screen_Cols <= 0)
{
- if ((cp = getenv("COLUMNS")) != NULL && mutt_str_atoi(cp, &SLtt_Screen_Cols) < 0)
+ cp = getenv("COLUMNS");
+ if (cp && (mutt_str_atoi(cp, &SLtt_Screen_Cols) < 0))
SLtt_Screen_Cols = 80;
}
#ifdef USE_SLANG_CURSES