{
if (buflen == 0)
goto done;
- if (mutt_str_strcmp(addr->mailbox, "@") != 0)
+ if (mutt_str_strcmp(addr->mailbox, "@") == 0)
+ {
+ *pbuf = '\0';
+ }
+ else
{
const char *a = display ? mutt_addr_for_display(addr) : addr->mailbox;
len = mutt_str_strfcpy(pbuf, a, buflen + 1 /* strfcpy terminates */);
pbuf += len;
buflen -= len;
}
- else
- {
- *pbuf = '\0';
- }
if (addr->personal || (addr->mailbox && (*addr->mailbox == '@')))
{
if (reno_ok)
regfree(&reno);
- if (MuttMessageWindow->rows != 1)
+ if (MuttMessageWindow->rows == 1)
{
- mutt_window_reflow_message_rows(1);
- mutt_menu_current_redraw();
+ mutt_window_clearline(MuttMessageWindow, 0);
}
else
- mutt_window_clearline(MuttMessageWindow, 0);
-
- if (def != MUTT_ABORT)
{
- mutt_window_addstr((char *) ((def == MUTT_YES) ? yes : no));
- mutt_refresh();
+ mutt_window_reflow_message_rows(1);
+ mutt_menu_current_redraw();
}
- else
+
+ if (def == MUTT_ABORT)
{
/* when the users cancels with ^G, clear the message stored with
* mutt_message() so it isn't displayed when the screen is refreshed. */
mutt_clear_error();
}
+ else
+ {
+ mutt_window_addstr((char *) ((def == MUTT_YES) ? yes : no));
+ mutt_refresh();
+ }
return def;
}
}
mutt_beep(false);
}
- if (MuttMessageWindow->rows != 1)
+ if (MuttMessageWindow->rows == 1)
+ {
+ mutt_window_clearline(MuttMessageWindow, 0);
+ }
+ else
{
mutt_window_reflow_message_rows(1);
mutt_menu_current_redraw();
}
- else
- mutt_window_clearline(MuttMessageWindow, 0);
mutt_refresh();
return choice;
}
mutt_str_pretty_size(length, sizeof(length), b->length);
state_mark_attach(s);
char *charset = mutt_param_get(&b->parameter, "charset");
- if (n != 0)
+ if (n == 0)
{
- state_printf(s, _("[-- Alternative Type #%d: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
- n, TYPE(b), b->subtype, charset ? "; charset=" : "",
+ state_printf(s, _("[-- Type: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
+ TYPE(b), b->subtype, charset ? "; charset=" : "",
charset ? charset : "", ENCODING(b->encoding), length);
}
else
{
- state_printf(s, _("[-- Type: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
- TYPE(b), b->subtype, charset ? "; charset=" : "",
+ state_printf(s, _("[-- Alternative Type #%d: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
+ n, TYPE(b), b->subtype, charset ? "; charset=" : "",
charset ? charset : "", ENCODING(b->encoding), length);
}
}
if (*t3)
{
- if (mutt_str_strcmp(C_Pager, "builtin") != 0)
- {
- fputc('\n', fp);
- n = 0;
- }
- else
+ if (mutt_str_strcmp(C_Pager, "builtin") == 0)
{
n += col - wraplen;
if (C_Markers)
n++;
}
+ else
+ {
+ fputc('\n', fp);
+ n = 0;
+ }
col = pad(fp, n, col_b);
}
}
mutt_message(_("Getting folder list..."));
/* skip check for parents when at the root */
- if (buf[0] != '\0')
+ if (buf[0] == '\0')
{
- imap_fix_path(adata->delim, buf, mbox, sizeof(mbox));
- n = mutt_str_strlen(mbox);
+ mbox[0] = '\0';
+ n = 0;
}
else
{
- mbox[0] = '\0';
- n = 0;
+ imap_fix_path(adata->delim, buf, mbox, sizeof(mbox));
+ n = mutt_str_strlen(mbox);
}
if (n)
if (buf->data && (*buf->data != '\0'))
{
/* Expand and subscribe */
- if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), true) != 0)
- {
- mutt_buffer_printf(err, _("Could not subscribe to %s"), buf->data);
- return MUTT_CMD_ERROR;
- }
- else
+ if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), true) == 0)
{
mutt_message(_("Subscribed to %s"), buf->data);
return MUTT_CMD_SUCCESS;
}
- }
- else
- {
- mutt_debug(LL_DEBUG1, "Corrupted buffer");
+
+ mutt_buffer_printf(err, _("Could not subscribe to %s"), buf->data);
return MUTT_CMD_ERROR;
}
+
+ mutt_debug(LL_DEBUG1, "Corrupted buffer");
+ return MUTT_CMD_ERROR;
}
mutt_buffer_addstr(err, _("No folder specified"));
if (buf->data && (*buf->data != '\0'))
{
/* Expand and subscribe */
- if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), false) != 0)
- {
- mutt_buffer_printf(err, _("Could not unsubscribe from %s"), buf->data);
- return MUTT_CMD_ERROR;
- }
- else
+ if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), false) == 0)
{
mutt_message(_("Unsubscribed from %s"), buf->data);
return MUTT_CMD_SUCCESS;
}
- }
- else
- {
- mutt_debug(LL_DEBUG1, "Corrupted buffer");
+
+ mutt_buffer_printf(err, _("Could not unsubscribe from %s"), buf->data);
return MUTT_CMD_ERROR;
}
+
+ mutt_debug(LL_DEBUG1, "Corrupted buffer");
+ return MUTT_CMD_ERROR;
}
mutt_buffer_addstr(err, _("No folder specified"));
nm_parse_type_from_query(mdata, buf);
- if (get_limit(mdata) != C_NmDbLimit)
+ if (get_limit(mdata) == C_NmDbLimit)
{
- added = snprintf(uri, sizeof(uri), "%s%s?type=%s&limit=%d&query=", NmUriProtocol,
- nm_db_get_filename(m),
- query_type_to_string(mdata->query_type), get_limit(mdata));
+ added = snprintf(uri, sizeof(uri), "%s%s?type=%s&query=", NmUriProtocol,
+ nm_db_get_filename(m), query_type_to_string(mdata->query_type));
}
else
{
- added = snprintf(uri, sizeof(uri), "%s%s?type=%s&query=", NmUriProtocol,
- nm_db_get_filename(m), query_type_to_string(mdata->query_type));
+ added = snprintf(uri, sizeof(uri), "%s%s?type=%s&limit=%d&query=", NmUriProtocol,
+ nm_db_get_filename(m),
+ query_type_to_string(mdata->query_type), get_limit(mdata));
}
if (added >= sizeof(uri))
{
int flags = mutt_mb_is_lower(rd->searchbuf) ? REG_ICASE : 0;
const int err = REG_COMP(&rd->search_re, rd->searchbuf, REG_NEWLINE | flags);
- if (err != 0)
+ if (err == 0)
{
- regerror(err, &rd->search_re, buf, sizeof(buf));
- mutt_error("%s", buf);
- rd->search_compiled = false;
+ rd->search_flag = MUTT_SEARCH;
+ rd->search_back = Resize->search_back;
}
else
{
- rd->search_flag = MUTT_SEARCH;
- rd->search_back = Resize->search_back;
+ regerror(err, &rd->search_re, buf, sizeof(buf));
+ mutt_error("%s", buf);
+ rd->search_compiled = false;
}
}
rd->lines = Resize->line;
break;
case OP_PREV_PAGE:
- if (rd.topline != 0)
+ if (rd.topline == 0)
+ {
+ mutt_message(_("Top of message is shown"));
+ }
+ else
{
rd.topline = up_n_lines(rd.pager_window->rows - C_PagerContext,
rd.line_info, rd.topline, rd.hide_quoted);
}
- else
- mutt_message(_("Top of message is shown"));
break;
case OP_NEXT_LINE:
if (progress->inc == 0)
{
/* This progress bar does not increment - write the initial message */
- if (progress->size != 0)
+ if (progress->size == 0)
{
- mutt_message("%s (%s)", progress->msg, progress->sizestr);
+ mutt_message(progress->msg);
}
else
{
- mutt_message(progress->msg);
+ mutt_message("%s (%s)", progress->msg, progress->sizestr);
}
}
else
if (was_cr)
{
was_cr = false;
- if (ch != '\n')
- {
- info->binary = true;
- }
- else
+ if (ch == '\n')
{
if (whitespace)
info->space = true;
linelen = 0;
continue;
}
+
+ info->binary = true;
}
linelen++;