Skip to content

Commit

Permalink
Reduce variable scope - imap/imap.c
Browse files Browse the repository at this point in the history
  • Loading branch information
fekir authored and flatcap committed Mar 3, 2018
1 parent f929bc3 commit 72fe41b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions imap/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ static int check_capabilities(struct ImapData *idata)
*/
static char *get_flags(struct ListHead *hflags, char *s)
{
char *flag_word = NULL;
char ctmp;

/* sanity-check string */
if (mutt_str_strncasecmp("FLAGS", s, 5) != 0)
{
Expand All @@ -168,10 +165,10 @@ static char *get_flags(struct ListHead *hflags, char *s)
{
s++;
SKIPWS(s);
flag_word = s;
const char* flag_word = s;
while (*s && (*s != ')') && !ISSPACE(*s))
s++;
ctmp = *s;
const char ctmp = *s;
*s = '\0';
if (*flag_word)
mutt_list_insert_tail(hflags, mutt_str_strdup(flag_word));
Expand Down Expand Up @@ -226,15 +223,14 @@ static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag,
bool changed, bool invert, int *pos)
{
int count = 0; /* number of messages in message set */
bool match = false; /* whether current message matches flag condition */
unsigned int setstart = 0; /* start of current message range */
int n;
bool started = false;
struct Header **hdrs = idata->ctx->hdrs;

for (n = *pos; n < idata->ctx->msgcount && buf->dptr - buf->data < IMAP_MAX_CMDLEN; n++)
{
match = false;
bool match = false; /* whether current message matches flag condition */
/* don't include pending expunged messages */
if (hdrs[n]->active)
{
Expand Down

0 comments on commit 72fe41b

Please sign in to comment.