{
s += 1;
*col = strtoul(s, &eptr, 16);
- if (!*s || *eptr || (*col == COLOR_UNSET && !OptNoCurses && has_colors()))
+ if (!*s || *eptr || ((*col == COLOR_UNSET) && !OptNoCurses && has_colors()))
{
snprintf(err->data, err->dsize, _("%s: color not supported by term"), s);
return -1;
fputs(prefix, fp_out);
- while ((c = fgetc(fp_in)) != EOF && bytes--)
+ while (((c = fgetc(fp_in)) != EOF) && bytes--)
{
fputc(c, fp_out);
if (c == '\n')
SETCOLOR(MT_COLOR_PROMPT);
addnstr(prompt, cur - prompt);
- if (isalnum(cur[1]) && cur[2] == ')')
+ if (isalnum(cur[1]) && (cur[2] == ')'))
{
// we have a single letter within parentheses
SETCOLOR(MT_COLOR_OPTIONS);
{
/* remove trailing whitespace from the line */
p = tmp + mutt_str_strlen(tmp) - 1;
- while (p >= tmp && ISSPACE(*p))
+ while ((p >= tmp) && ISSPACE(*p))
*p-- = '\0';
p = tmp + 2;
{
i = p - s;
/* remove whitespace from the end of the attribute name */
- while (i > 0 && mutt_str_is_email_wsp(s[i - 1]))
+ while ((i > 0) && mutt_str_is_email_wsp(s[i - 1]))
i--;
/* the check for the missing parameter token is here so that we can skip
else
{
state->curpos++;
- while (state->curpos < state->lastchar &&
+ while ((state->curpos < state->lastchar) &&
COMB_CHAR(state->wbuf[state->curpos]))
{
state->curpos++;
int c;
char bufi[BUFI_SIZE];
size_t l = 0;
- while ((c = fgetc(s->fp_in)) != EOF && len--)
+ while (((c = fgetc(s->fp_in)) != EOF) && len--)
{
if ((c == '\r') && len)
{
/* chop trailing whitespace if we got the full line */
if (last == '\n')
{
- while (linelen > 0 && ISSPACE(line[linelen - 1]))
+ while ((linelen > 0) && ISSPACE(line[linelen - 1]))
linelen--;
line[linelen] = '\0';
}
if ((mutt_str_strcmp(buf, "-- ") != 0) && C_TextFlowed)
{
l = mutt_str_strlen(buf);
- while (l > 0 && buf[l - 1] == ' ')
+ while ((l > 0) && (buf[l - 1] == ' '))
buf[--l] = '\0';
}
if (s->prefix)
irc = IMAP_CMD_CONTINUE;
/* looping protocol */
- while (rc == SASL_CONTINUE || olen > 0)
+ while ((rc == SASL_CONTINUE) || (olen > 0))
{
do
irc = imap_cmd_step(adata);
return;
}
s++;
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
s++;
if (*s == ')')
s++;
return;
}
s++;
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
s++;
if (*s == ')')
s++;
mutt_debug(LL_DEBUG2, "Handling SEARCH\n");
- while ((s = imap_next_word((char *) s)) && *s != '\0')
+ while ((s = imap_next_word((char *) s)) && (*s != '\0'))
{
if (mutt_str_atoui(s, &uid) < 0)
continue;
mutt_debug(LL_DEBUG1, "Error parsing STATUS\n");
return;
}
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
{
value = imap_next_word(s);
{
mutt_debug(LL_DEBUG2, "Handling ENABLED\n");
- while ((s = imap_next_word((char *) s)) && *s != '\0')
+ while ((s = imap_next_word((char *) s)) && (*s != '\0'))
{
if (mutt_str_startswith(s, "UTF8=ACCEPT", CASE_IGNORE) ||
mutt_str_startswith(s, "UTF8=ONLY", CASE_IGNORE))
}
/* update caller's flags handle */
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
{
s++;
SKIPWS(s);
{
size_t pos = start;
- while (pos < dlen && dest[pos] && dest[pos] == src[pos])
+ while ((pos < dlen) && dest[pos] && (dest[pos] == src[pos]))
pos++;
dest[pos] = '\0';
}
/* Skip duplicate space */
- while (*checker == ' ' && *(checker + 1) == ' ')
+ while ((*checker == ' ') && (*(checker + 1) == ' '))
checker++;
/* copy char to new and go the next one */
edata->old = false;
/* start parsing */
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
{
if ((plen = mutt_str_startswith(s, "\\deleted", CASE_IGNORE)))
{
char *flag_word = s;
bool is_system_keyword = mutt_str_startswith(s, "\\", CASE_IGNORE);
- while (*s && !ISSPACE(*s) && *s != ')')
+ while (*s && !ISSPACE(*s) && (*s != ')'))
s++;
ctmp = *s;
return -1;
}
s++;
- while (*s && *s != ')')
+ while (*s && (*s != ')'))
s++;
if (*s == ')')
s++;
int i = 0;
char delim = server_delim;
- while (mailbox && *mailbox && i < plen - 1)
+ while (mailbox && *mailbox && (i < plen - 1))
{
if ((C_ImapDelimChars && strchr(C_ImapDelimChars, *mailbox)) ||
(delim && (*mailbox == delim)))
delim = *mailbox;
while (*mailbox && ((C_ImapDelimChars && strchr(C_ImapDelimChars, *mailbox)) ||
- (delim && *mailbox == delim)))
+ (delim && (*mailbox == delim))))
{
mailbox++;
}
sigaction(SIGALRM, &act, &oldalrm);
alarm(C_ImapKeepalive);
- while (waitpid(pid, &rc, 0) < 0 && errno == EINTR)
+ while ((waitpid(pid, &rc, 0) < 0) && (errno == EINTR))
{
alarm(0); /* cancel a possibly pending alarm */
imap_keepalive();
SETCOLOR(MT_COLOR_TREE);
#endif
- while (*s && *s < MUTT_TREE_MAX)
+ while (*s && (*s < MUTT_TREE_MAX))
{
switch (*s)
{
search_next:
if (wrap)
mutt_message(_("Search wrapped to top"));
- while (rc >= 0 && rc < menu->max)
+ while ((rc >= 0) && (rc < menu->max))
{
if (menu->menu_search(menu, &re, rc) == 0)
{
*/
static struct History *get_history(enum HistoryClass hclass)
{
- if (hclass >= HC_MAX || C_History == 0)
+ if ((hclass >= HC_MAX) || (C_History == 0))
return NULL;
struct History *hist = &Histories[hclass];
bool mutt_str_is_ascii(const char *p, size_t len)
{
const char *s = p;
- while (s && (unsigned int) (s - p) < len)
+ while (s && ((unsigned int) (s - p) < len))
{
if ((*s & 0x80) != 0)
return false;
mutt_list_insert_after(subjects, np, env->real_subj);
}
- while (!cur->next && cur != start)
+ while (!cur->next && (cur != start))
{
cur = cur->parent;
}
}
}
- while (!tmp->next && tmp != cur)
+ while (!tmp->next && (tmp != cur))
{
tmp = tmp->parent;
}
while (!tmp->message)
tmp = tmp->child;
tmp->check_subject = true;
- while (!tmp->next && tmp != thread)
+ while (!tmp->next && (tmp != thread))
tmp = tmp->parent;
if (tmp != thread)
tmp = tmp->next;
{
/* Scan backwards for backslashes */
off = n;
- while (off > 0 && src[off - 2] == '\\')
+ while ((off > 0) && (src[off - 2] == '\\'))
off--;
}
if (n > 0)
{
buf[n] = '\0';
- while ((n > 0) && (buf[n - 1] == '\n' || buf[n - 1] == '\r'))
+ while ((n > 0) && ((buf[n - 1] == '\n') || (buf[n - 1] == '\r')))
buf[--n] = '\0';
mutt_debug(5, "fmtpipe < %s\n", buf);
}
}
- while (*src && wlen < buflen)
+ while (*src && (wlen < buflen))
{
if (*src == '%')
{
/* eat the format string */
cp = prefix;
count = 0;
- while (count < sizeof(prefix) && (isdigit((unsigned char) *src) ||
- *src == '.' || *src == '-' || *src == '='))
+ while ((count < sizeof(prefix)) && (isdigit((unsigned char) *src) || (*src == '.') ||
+ (*src == '-') || (*src == '=')))
{
*cp++ = *src++;
count++;
bool tolower = false;
bool nodots = false;
- while (ch == '_' || ch == ':')
+ while ((ch == '_') || (ch == ':'))
{
if (ch == '_')
tolower = true;
ctx = create_gpgme_context(false);
engineinfo = gpgme_ctx_get_engine_info(ctx);
- while (engineinfo && engineinfo->protocol != GPGME_PROTOCOL_OpenPGP)
+ while (engineinfo && (engineinfo->protocol != GPGME_PROTOCOL_OpenPGP))
engineinfo = engineinfo->next;
if (!engineinfo)
{
}
engineinfo = gpgme_ctx_get_engine_info(tmpctx);
- while (engineinfo && engineinfo->protocol != GPGME_PROTOCOL_OpenPGP)
+ while (engineinfo && (engineinfo->protocol != GPGME_PROTOCOL_OpenPGP))
engineinfo = engineinfo->next;
if (!engineinfo)
{
}
len = buflen - 1;
- while (len > 0 && *cp != ']')
+ while ((len > 0) && (*cp != ']'))
{
if (*cp == '%')
{
}
fputs(buf, fp_tmp);
- while (bytes > 0 && fgets(buf, sizeof(buf) - 1, s->fp_in))
+ while ((bytes > 0) && fgets(buf, sizeof(buf) - 1, s->fp_in))
{
offset = ftello(s->fp_in);
bytes -= (offset - last_pos); /* don't rely on mutt_str_strlen(buf) */
}
len = buflen - 1;
- while (len > 0 && *cp != ']')
+ while ((len > 0) && (*cp != ']'))
{
if (*cp == '%')
{
snprintf(buf, sizeof(buf), "AUTHINFO SASL %s", method);
/* looping protocol */
- while (rc == SASL_CONTINUE || (rc == SASL_OK && client_len))
+ while ((rc == SASL_CONTINUE) || ((rc == SASL_OK) && client_len))
{
/* send out client response */
if (client_len)
{
int count = 0;
- while (n > 0 && count <= NUM_SIG_LINES)
+ while ((n > 0) && (count <= NUM_SIG_LINES))
{
if (info[n].type != MT_COLOR_SIGNATURE)
break;
{
def_color = class->color;
- while (class && class->length > cnt)
+ while (class && (class->length > cnt))
{
def_color = class->color;
class = class->up;
i = n + 1;
line_info[n].type = MT_COLOR_SIGNATURE;
- while (i < last && check_sig(buf, line_info, i - 1) == 0 &&
- (line_info[i].type == MT_COLOR_NORMAL || line_info[i].type == MT_COLOR_QUOTED ||
- line_info[i].type == MT_COLOR_HEADER))
+ while ((i < last) && (check_sig(buf, line_info, i - 1) == 0) &&
+ ((line_info[i].type == MT_COLOR_NORMAL) || (line_info[i].type == MT_COLOR_QUOTED) ||
+ (line_info[i].type == MT_COLOR_HEADER)))
{
/* oops... */
if (line_info[i].chunks)
*/
static bool is_ansi(unsigned char *buf)
{
- while ((*buf != '\0') && (isdigit(*buf) || *buf == ';'))
+ while ((*buf != '\0') && (isdigit(*buf) || (*buf == ';')))
buf++;
return *buf == 'm';
}
{
int x = pos;
- while (isdigit(buf[x]) || buf[x] == ';')
+ while (isdigit(buf[x]) || (buf[x] == ';'))
x++;
/* Character Attributes */
}
else
{
- while (pos < x && buf[pos] != ';')
+ while ((pos < x) && (buf[pos] != ';'))
pos++;
pos++;
}
for (ch = 0, vch = 0; ch < cnt; ch += k, vch += k)
{
/* Handle ANSI sequences */
- while (cnt - ch >= 2 && buf[ch] == '\033' && buf[ch + 1] == '[' && is_ansi(buf + ch + 2))
+ while ((cnt - ch >= 2) && (buf[ch] == '\033') && (buf[ch + 1] == '[') &&
+ is_ansi(buf + ch + 2))
ch = grok_ansi(buf, ch + 2, pa) + 1;
- while (cnt - ch >= 2 && buf[ch] == '\033' && buf[ch + 1] == ']' &&
+ while ((cnt - ch >= 2) && (buf[ch] == '\033') && (buf[ch + 1] == ']') &&
((check_attachment_marker((char *) buf + ch) == 0) ||
(check_protected_header_marker((char *) buf + ch) == 0)))
{
{
buf_ptr = buf + ch;
/* skip trailing blanks */
- while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r'))
+ while (ch && ((buf[ch] == ' ') || (buf[ch] == '\t') || (buf[ch] == '\r')))
ch--;
/* A very long word with leading spaces causes infinite
* wrapping when MUTT_PAGER_NSKIP is set. A folded header
if (!(flags & MUTT_PAGER_NSKIP))
{
/* skip leading blanks on the next line too */
- while (*buf_ptr == ' ' || *buf_ptr == '\t')
+ while ((*buf_ptr == ' ') || (*buf_ptr == '\t'))
buf_ptr++;
}
}
*/
static int up_n_lines(int nlines, struct Line *info, int cur, bool hiding)
{
- while (cur > 0 && nlines > 0)
+ while ((cur > 0) && (nlines > 0))
{
cur--;
if (!hiding || (info[cur].type != MT_COLOR_QUOTED))
rd->lines = 0;
rd->force_redraw = false;
- while (rd->lines < rd->pager_window->rows &&
- rd->line_info[rd->curline].offset <= rd->sb.st_size - 1)
+ while ((rd->lines < rd->pager_window->rows) &&
+ (rd->line_info[rd->curline].offset <= rd->sb.st_size - 1))
{
if (display_line(rd->fp, &rd->last_pos, &rd->line_info, rd->curline,
&rd->last_line, &rd->max_line,
/* Skip all the email headers */
if (ISHEADER(rd.line_info[new_topline].type))
{
- while ((new_topline < rd.last_line ||
+ while (((new_topline < rd.last_line) ||
(0 == (dretval = display_line(
rd.fp, &rd.last_pos, &rd.line_info, new_topline, &rd.last_line,
&rd.max_line, MUTT_TYPES | (flags & MUTT_PAGER_NOWRAP),
break;
}
- while (((new_topline + C_SkipQuotedOffset) < rd.last_line ||
+ while ((((new_topline + C_SkipQuotedOffset) < rd.last_line) ||
(0 == (dretval = display_line(
rd.fp, &rd.last_pos, &rd.line_info, new_topline, &rd.last_line,
&rd.max_line, MUTT_TYPES | (flags & MUTT_PAGER_NOWRAP),
&rd.quote_list, &rd.q_level, &rd.force_redraw,
&rd.search_re, rd.pager_window)))) &&
- rd.line_info[new_topline + C_SkipQuotedOffset].type != MT_COLOR_QUOTED)
+ (rd.line_info[new_topline + C_SkipQuotedOffset].type != MT_COLOR_QUOTED))
{
new_topline++;
}
break;
}
- while (((new_topline + C_SkipQuotedOffset) < rd.last_line ||
+ while ((((new_topline + C_SkipQuotedOffset) < rd.last_line) ||
(0 == (dretval = display_line(
rd.fp, &rd.last_pos, &rd.line_info, new_topline, &rd.last_line,
&rd.max_line, MUTT_TYPES | (flags & MUTT_PAGER_NOWRAP),
&rd.quote_list, &rd.q_level, &rd.force_redraw,
&rd.search_re, rd.pager_window)))) &&
- rd.line_info[new_topline + C_SkipQuotedOffset].type == MT_COLOR_QUOTED)
+ (rd.line_info[new_topline + C_SkipQuotedOffset].type == MT_COLOR_QUOTED))
{
new_topline++;
}
int i = 0;
buf[i++] = '"';
- while (*str && i < buflen - 3)
+ while (*str && (i < buflen - 3))
{
if ((*str == '\\') || (*str == '"'))
buf[i++] = '\\';
{
short level = actx->idx[i]->level;
- while ((++i < actx->idxlen) && actx->idx[i]->level > level)
+ while ((++i < actx->idxlen) && (actx->idx[i]->level > level))
{
if (actx->idx[i]->content == cur)
return true;
if (C_MailcapSanitize)
mutt_file_sanitize_filename(type2, false);
- while (x < clen - 1 && command[x] && y < sizeof(buf) - 1)
+ while ((x < clen - 1) && command[x] && (y < sizeof(buf) - 1))
{
if (command[x] == '\\')
{
int z = 0;
x++;
- while (command[x] && command[x] != '}' && z < sizeof(param) - 1)
+ while (command[x] && (command[x] != '}') && (z < sizeof(param) - 1))
param[z++] = command[x++];
param[z] = '\0';
while (!found && *curr)
{
int x = 0;
- while (*curr && *curr != ':' && x < sizeof(path) - 1)
+ while (*curr && (*curr != ':') && (x < sizeof(path) - 1))
{
path[x++] = *curr;
curr++;
int quoted = 0;
char *p = (char *) line;
- while (p && *p == '>')
+ while (p && (*p == '>'))
{
quoted++;
p++;
if ((chflags & CH_DISPLAY) && ((*(value + 1) == ' ') || (*(value + 1) == '\t')))
{
value++;
- while (*value && (*value == ' ' || *value == '\t'))
+ while (*value && ((*value == ' ') || (*value == '\t')))
value++;
if (fputc('\t', fp) == EOF)
return -1;
if (display && fold)
{
char *pc = buf;
- while (*pc && (*pc == ' ' || *pc == '\t'))
+ while (*pc && ((*pc == ' ') || (*pc == '\t')))
{
pc++;
col--;
* XXX this covers ASCII space only, for display we probably
* want something like iswspace() here */
const char *sp = next;
- while (*sp && (*sp == ' ' || *sp == '\t'))
+ while (*sp && ((*sp == ' ') || (*sp == '\t')))
sp++;
if (*sp == '\n')
{
/* skip over any leading whitespace (WSP, as defined in RFC5322)
* NOTE: mutt_str_skip_email_wsp() does the wrong thing here.
* See tickets 3609 and 3716. */
- while (*t == ' ' || *t == '\t')
+ while ((*t == ' ') || (*t == '\t'))
t++;
valbuf = mutt_str_substr_dup(t, end);
{
const wchar_t *p = ws;
- while (p && *p != L'\0')
+ while (p && (*p != L'\0'))
{
if (state_putwc(*p, s) < 0)
return -1;