if (raw_socket_open(conn) < 0)
return -1;
- int ret = ssl_setup(conn);
- if (ret)
+ int rc = ssl_setup(conn);
+ if (rc)
raw_socket_close(conn);
- return ret;
+ return rc;
}
/**
if (ssl_init())
return -1;
- int ret = ssl_setup(conn);
+ int rc = ssl_setup(conn);
/* hmm. watch out if we're starting TLS over any method other than raw. */
conn->conn_read = ssl_socket_read;
conn->conn_write = ssl_socket_write;
conn->conn_close = ssl_socket_close_and_restore;
- return ret;
+ return rc;
}
/**
int mutt_hcache_store(header_cache_t *hc, const char *key, size_t keylen,
struct Email *e, unsigned int uidvalidity)
{
- char *data = NULL;
- int dlen;
- int ret;
-
if (!hc)
return -1;
- data = mutt_hcache_dump(hc, e, &dlen, uidvalidity);
- ret = mutt_hcache_store_raw(hc, key, keylen, data, dlen);
+ int dlen = 0;
+
+ char *data = mutt_hcache_dump(hc, e, &dlen, uidvalidity);
+ int rc = mutt_hcache_store_raw(hc, key, keylen, data, dlen);
FREE(&data);
- return ret;
+ return rc;
}
/**
*/
uint32_t mutt_rand32(void)
{
- uint32_t ret = 0;
+ uint32_t num = 0;
- if (mutt_randbuf(&ret, sizeof(ret)) < 0)
+ if (mutt_randbuf(&num, sizeof(num)) < 0)
mutt_exit(1);
- return ret;
+ return num;
}
/**
*/
uint64_t mutt_rand64(void)
{
- uint64_t ret = 0;
+ uint64_t num = 0;
- if (mutt_randbuf(&ret, sizeof(ret)) < 0)
+ if (mutt_randbuf(&num, sizeof(num)) < 0)
mutt_exit(1);
- return ret;
+ return num;
}
/**
struct NntpMboxData *mdata = m->mdata;
struct NntpAccountData *adata = mdata->adata;
time_t now = time(NULL);
- int rc, ret = 0;
+ int rc = 0;
void *hc = NULL;
if (adata->check_time + C_NntpPoll > now)
return -1;
adata->check_time = now;
- rc = nntp_group_poll(mdata, false);
- if (rc < 0)
+ int rc2 = nntp_group_poll(mdata, false);
+ if (rc2 < 0)
{
nntp_newsrc_close(adata);
return -1;
}
- if (rc)
+ if (rc2 != 0)
nntp_active_save_cache(adata);
/* articles have been renumbered, remove all headers */
if (C_NntpContext && mdata->last_message - mdata->last_loaded > C_NntpContext)
mdata->last_loaded = mdata->last_message - C_NntpContext;
}
- ret = MUTT_REOPENED;
+ rc = MUTT_REOPENED;
}
/* .newsrc has been externally modified */
#endif
adata->newsrc_modified = false;
- ret = MUTT_REOPENED;
+ rc = MUTT_REOPENED;
}
/* some headers were removed, context must be updated */
- if (ret == MUTT_REOPENED)
+ if (rc == MUTT_REOPENED)
mutt_mailbox_changed(m, MBN_INVALID);
/* fetch headers of new articles */
}
#endif
int old_msg_count = m->msg_count;
- rc = nntp_fetch_headers(m, hc, mdata->last_loaded + 1, mdata->last_message, false);
+ rc2 = nntp_fetch_headers(m, hc, mdata->last_loaded + 1, mdata->last_message, false);
m->quiet = quiet;
- if (rc == 0)
+ if (rc2 == 0)
{
if (m->msg_count > old_msg_count)
mutt_mailbox_changed(m, MBN_INVALID);
mdata->last_loaded = mdata->last_message;
}
- if (ret == 0 && m->msg_count > oldmsgcount)
- ret = MUTT_NEW_MAIL;
+ if (rc == 0 && m->msg_count > oldmsgcount)
+ rc = MUTT_NEW_MAIL;
}
#ifdef USE_HCACHE
mutt_hcache_close(hc);
#endif
- if (ret)
+ if (rc)
nntp_newsrc_close(adata);
mutt_clear_error();
- return ret;
+ return rc;
}
/**
if (!m)
return -1;
- int ret = check_mailbox(m);
- if (ret == 0)
+ int rc = check_mailbox(m);
+ if (rc == 0)
{
struct NntpMboxData *mdata = m->mdata;
struct NntpAccountData *adata = mdata->adata;
nntp_newsrc_close(adata);
}
- return ret;
+ return rc;
}
/**
case MUTT_DRIVER_TAGS:
{
char *tags = driver_tags_get(&e->tags);
- bool ret = (pat->not^(tags &&patmatch(pat, tags) == 0));
+ bool rc = (pat->not^(tags &&patmatch(pat, tags) == 0));
FREE(&tags);
- return ret;
+ return rc;
}
case MUTT_HORMEL:
if (!e->env)
m->emails[i]->refno = -1;
const int old_count = m->msg_count;
- int ret = pop_fetch_data(adata, "UIDL\r\n", NULL, fetch_uidl, m);
+ int rc = pop_fetch_data(adata, "UIDL\r\n", NULL, fetch_uidl, m);
const int new_count = m->msg_count;
m->msg_count = old_count;
if (adata->cmd_uidl == 2)
{
- if (ret == 0)
+ if (rc == 0)
{
adata->cmd_uidl = 1;
mutt_debug(LL_DEBUG1, "set UIDL capability\n");
}
- if (ret == -2 && adata->cmd_uidl == 2)
+ if (rc == -2 && adata->cmd_uidl == 2)
{
adata->cmd_uidl = 0;
MUTT_PROGRESS_MSG, C_ReadInc, new_count - old_count);
}
- if (ret == 0)
+ if (rc == 0)
{
int i, deleted;
for (i = 0, deleted = 0; i < old_count; i++)
/* Reattach the private data */
m->emails[i]->edata = edata;
m->emails[i]->free_edata = pop_edata_free;
- ret = 0;
+ rc = 0;
hcached = true;
}
else
#endif
- if ((ret = pop_read_header(adata, m->emails[i])) < 0)
+ if ((rc = pop_read_header(adata, m->emails[i])) < 0)
break;
#ifdef USE_HCACHE
else
mutt_hcache_close(hc);
#endif
- if (ret < 0)
+ if (rc < 0)
{
for (int i = m->msg_count; i < new_count; i++)
mutt_email_free(&m->emails[i]);
- return ret;
+ return rc;
}
/* after putting the result into our structures,
mutt_message(_("Fetching list of messages..."));
- const int ret = pop_fetch_headers(m);
+ const int rc = pop_fetch_headers(m);
- if (ret >= 0)
+ if (rc >= 0)
return 0;
- if (ret < -1)
+ if (rc < -1)
return -1;
}
}
mutt_message(_("Checking for new messages..."));
int old_msg_count = m->msg_count;
- int ret = pop_fetch_headers(m);
+ int rc = pop_fetch_headers(m);
pop_clear_cache(adata);
if (m->msg_count > old_msg_count)
mutt_mailbox_changed(m, MBN_INVALID);
- if (ret < 0)
+ if (rc < 0)
return -1;
- if (ret > 0)
+ if (rc > 0)
return MUTT_NEW_MAIL;
return 0;
if (!m)
return -1;
- int i, j, ret = 0;
+ int i, j, rc = 0;
char buf[1024];
struct PopAccountData *adata = pop_adata_get(m);
struct Progress progress;
hc = pop_hcache_open(adata, m->path);
#endif
- for (i = 0, j = 0, ret = 0; (ret == 0) && (i < m->msg_count); i++)
+ for (i = 0, j = 0, rc = 0; (rc == 0) && (i < m->msg_count); i++)
{
struct PopEmailData *edata = m->emails[i]->edata;
if (m->emails[i]->deleted && m->emails[i]->refno != -1)
if (!m->quiet)
mutt_progress_update(&progress, j, -1);
snprintf(buf, sizeof(buf), "DELE %d\r\n", m->emails[i]->refno);
- ret = pop_query(adata, buf, sizeof(buf));
- if (ret == 0)
+ rc = pop_query(adata, buf, sizeof(buf));
+ if (rc == 0)
{
mutt_bcache_del(adata->bcache, cache_id(edata->uid));
#ifdef USE_HCACHE
mutt_hcache_close(hc);
#endif
- if (ret == 0)
+ if (rc == 0)
{
mutt_str_strfcpy(buf, "QUIT\r\n", sizeof(buf));
- ret = pop_query(adata, buf, sizeof(buf));
+ rc = pop_query(adata, buf, sizeof(buf));
}
- if (ret == 0)
+ if (rc == 0)
{
adata->clear_cache = true;
pop_clear_cache(adata);
return 0;
}
- if (ret == -2)
+ if (rc == -2)
{
mutt_error("%s", adata->err_msg);
return -1;
size_t lenbuf = 0;
mutt_str_strfcpy(buf, query, sizeof(buf));
- int ret = pop_query(adata, buf, sizeof(buf));
- if (ret < 0)
- return ret;
+ int rc = pop_query(adata, buf, sizeof(buf));
+ if (rc < 0)
+ return rc;
char *inbuf = mutt_mem_malloc(sizeof(buf));
if (chunk < 0)
{
adata->status = POP_DISCONNECTED;
- ret = -1;
+ rc = -1;
break;
}
{
if (progress)
mutt_progress_update(progress, pos, -1);
- if ((ret == 0) && (func(inbuf, data) < 0))
- ret = -3;
+ if ((rc == 0) && (func(inbuf, data) < 0))
+ rc = -3;
lenbuf = 0;
}
}
FREE(&inbuf);
- return ret;
+ return rc;
}
/**