/* overload keyboard timeout to avoid many mailbox checks in a row.
* Most users don't like having to wait exactly when they press a key. */
- int result = 0;
+ int rc = 0;
/* try IDLE first, unless force is set */
if (!force && C_ImapIdle && (adata->capabilities & IMAP_CAP_IDLE) &&
}
if (adata->state == IMAP_IDLE)
{
- while ((result = mutt_socket_poll(adata->conn, 0)) > 0)
+ while ((rc = mutt_socket_poll(adata->conn, 0)) > 0)
{
if (imap_cmd_step(adata) != IMAP_CMD_CONTINUE)
{
return -1;
}
}
- if (result < 0)
+ if (rc < 0)
{
mutt_debug(LL_DEBUG1, "Poll failed, disabling IDLE\n");
adata->capabilities &= ~IMAP_CAP_IDLE; // Clear the flag
imap_cmd_finish(adata);
if (mdata->check_status & IMAP_EXPUNGE_PENDING)
- result = MUTT_REOPENED;
+ rc = MUTT_REOPENED;
else if (mdata->check_status & IMAP_NEWMAIL_PENDING)
- result = MUTT_NEW_MAIL;
+ rc = MUTT_NEW_MAIL;
else if (mdata->check_status & IMAP_FLAGS_PENDING)
- result = MUTT_FLAGS;
+ rc = MUTT_FLAGS;
mdata->check_status = IMAP_OPEN_NO_FLAGS;
- return result;
+ return rc;
}
/**
static enum CommandResult km_bind_err(const char *s, int menu, int op,
char *macro, char *desc, struct Buffer *err)
{
- enum CommandResult retval = MUTT_CMD_SUCCESS;
+ enum CommandResult rc = MUTT_CMD_SUCCESS;
struct Keymap *last = NULL, *next = NULL;
keycode_t buf[MAX_SEQ];
size_t pos = 0, lastpos = 0;
"https://neomutt.org/guide/configuration.html#bind-warnings"),
old_binding, new_binding, mutt_map_get_name(menu, Menus), new_binding);
}
- retval = MUTT_CMD_WARNING;
+ rc = MUTT_CMD_WARNING;
}
len = tmp->eq;
next = tmp->next;
Keymaps[menu] = map;
}
- return retval;
+ return rc;
}
/**
{
struct Email *e = NULL;
struct Envelope *tmp_envelope = NULL;
- bool result = false;
+ bool rc = false;
if (fseek_last_message(fp) == -1)
return false;
e = mutt_email_new();
tmp_envelope = mutt_rfc822_read_header(fp, e, false, false);
if (!(e->read || e->old))
- result = true;
+ rc = true;
mutt_env_free(&tmp_envelope);
mutt_email_free(&e);
- return result;
+ return rc;
}
/**
*/
static int menu_search(struct Menu *menu, int op)
{
- int r = 0, wrap = 0;
+ int rc = 0, wrap = 0;
int search_dir;
regex_t re;
char buf[128];
if (search_buf)
{
int flags = mutt_mb_is_lower(search_buf) ? REG_ICASE : 0;
- r = REGCOMP(&re, search_buf, REG_NOSUB | flags);
+ rc = REGCOMP(&re, search_buf, REG_NOSUB | flags);
}
- if (r != 0)
+ if (rc != 0)
{
- regerror(r, &re, buf, sizeof(buf));
+ regerror(rc, &re, buf, sizeof(buf));
mutt_error("%s", buf);
return -1;
}
- r = menu->current + search_dir;
+ rc = menu->current + search_dir;
search_next:
if (wrap)
mutt_message(_("Search wrapped to top"));
- while (r >= 0 && r < menu->max)
+ while (rc >= 0 && rc < menu->max)
{
- if (menu->menu_search(menu, &re, r) == 0)
+ if (menu->menu_search(menu, &re, rc) == 0)
{
regfree(&re);
- return r;
+ return rc;
}
- r += search_dir;
+ rc += search_dir;
}
if (C_WrapSearch && wrap++ == 0)
{
- r = search_dir == 1 ? 0 : menu->max - 1;
+ rc = search_dir == 1 ? 0 : menu->max - 1;
goto search_next;
}
regfree(&re);
*/
int mutt_str_remall_strcasestr(char *str, const char *target)
{
- int retval = 1;
+ int rc = 1;
// Look through an ensure all instances of the substring are gone.
while ((str = (char *) mutt_str_strcasestr(str, target)))
{
size_t target_len = mutt_str_strlen(target);
memmove(str, str + target_len, 1 + strlen(str + target_len));
- retval = 0; // If we got here, then a substring existed and has been removed.
+ rc = 0; // If we got here, then a substring existed and has been removed.
}
- return retval;
+ return rc;
}
/**
*/
static int pgp_check_decryption_okay(FILE *fp_in)
{
- int rv = -1;
+ int rc = -1;
char *line = NULL, *s = NULL;
int lineno = 0;
size_t linelen;
{
mutt_debug(LL_DEBUG2,
"\tPLAINTEXT encountered outside of DECRYPTION.\n");
- rv = -2;
+ rc = -2;
break;
}
}
else if (mutt_str_startswith(s, "DECRYPTION_FAILED", CASE_MATCH))
{
mutt_debug(LL_DEBUG2, "\tDECRYPTION_FAILED encountered. Failure.\n");
- rv = -3;
+ rc = -3;
break;
}
else if (mutt_str_startswith(s, "DECRYPTION_OKAY", CASE_MATCH))
/* Don't break out because we still have to check for
* PLAINTEXT outside of the decryption boundaries. */
mutt_debug(LL_DEBUG2, "\tDECRYPTION_OKAY encountered.\n");
- rv = 0;
+ rc = 0;
}
}
FREE(&line);
- return rv;
+ return rc;
}
/**
int smime_class_verify_sender(struct Email *e)
{
char *mbox = NULL, *certfile = NULL, tempfname[PATH_MAX];
- int retval = 1;
+ int rc = 1;
mutt_mktemp(tempfname, sizeof(tempfname));
FILE *fp_out = mutt_file_fopen(tempfname, "w");
mutt_any_key_to_continue(NULL);
}
else
- retval = 0;
+ rc = 0;
mutt_file_unlink(certfile);
FREE(&certfile);
}
mutt_any_key_to_continue(_("no mbox"));
mutt_file_unlink(tempfname);
- return retval;
+ return rc;
}
/*
*/
int smime_class_application_handler(struct Body *m, struct State *s)
{
- int rv = -1;
+ int rc = -1;
/* clear out any mime headers before the handler, so they can't be spoofed. */
mutt_env_free(&m->mime_headers);
struct Body *tattach = smime_handle_entity(m, s, NULL);
if (tattach)
{
- rv = 0;
+ rc = 0;
mutt_body_free(&tattach);
}
- return rv;
+ return rc;
}
/**
return false;
char *new_str = NULL;
- bool result = false;
+ bool rc = false;
if (safe_asprintf(&new_str, "id:%s and (%s)", email_get_id(e), orig_str) < 0)
return false;
if (!messages)
return false;
- result = notmuch_messages_valid(messages);
+ rc = notmuch_messages_valid(messages);
notmuch_messages_destroy(messages);
break;
}
if (!threads)
return false;
- result = notmuch_threads_valid(threads);
+ rc = notmuch_threads_valid(threads);
notmuch_threads_destroy(threads);
break;
}
notmuch_query_destroy(q);
mutt_debug(LL_DEBUG2, "nm: checking if message is still queried: %s = %s\n",
- new_str, result ? "true" : "false");
+ new_str, rc ? "true" : "false");
- return result;
+ return rc;
}
/**
struct Mailbox *m1 = sbe1->mailbox;
struct Mailbox *m2 = sbe2->mailbox;
- int result = 0;
+ int rc = 0;
switch ((C_SidebarSortMethod & SORT_MASK))
{
case SORT_COUNT:
if (m2->msg_count == m1->msg_count)
- result = mutt_str_strcoll(m1->path, m2->path);
+ rc = mutt_str_strcoll(m1->path, m2->path);
else
- result = (m2->msg_count - m1->msg_count);
+ rc = (m2->msg_count - m1->msg_count);
break;
case SORT_UNREAD:
if (m2->msg_unread == m1->msg_unread)
- result = mutt_str_strcoll(m1->path, m2->path);
+ rc = mutt_str_strcoll(m1->path, m2->path);
else
- result = (m2->msg_unread - m1->msg_unread);
+ rc = (m2->msg_unread - m1->msg_unread);
break;
case SORT_DESC:
- result = mutt_str_strcmp(m1->desc, m2->desc);
+ rc = mutt_str_strcmp(m1->desc, m2->desc);
break;
case SORT_FLAGGED:
if (m2->msg_flagged == m1->msg_flagged)
- result = mutt_str_strcoll(m1->path, m2->path);
+ rc = mutt_str_strcoll(m1->path, m2->path);
else
- result = (m2->msg_flagged - m1->msg_flagged);
+ rc = (m2->msg_flagged - m1->msg_flagged);
break;
case SORT_PATH:
{
- result = mutt_inbox_cmp(m1->path, m2->path);
- if (result == 0)
- result = mutt_str_strcoll(m1->path, m2->path);
+ rc = mutt_inbox_cmp(m1->path, m2->path);
+ if (rc == 0)
+ rc = mutt_str_strcoll(m1->path, m2->path);
break;
}
}
if (C_SidebarSortMethod & SORT_REVERSE)
- result = -result;
+ rc = -rc;
- return result;
+ return rc;
}
/**