From: Richard Russon Date: Fri, 24 Nov 2017 14:46:24 +0000 (+0000) Subject: insert braces X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40476fcedf96b935c738e1057a04a1cc35fc70d9;p=neomutt insert braces --- diff --git a/attach.c b/attach.c index d11d6e499..559ef66ce 100644 --- a/attach.c +++ b/attach.c @@ -388,7 +388,9 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, is_message = mutt_is_message_type(a->type, a->subtype); if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) && !crypt_valid_passphrase(a->hdr->security)) + { return rc; + } use_mailcap = (flag == MUTT_MAILCAP || (flag == MUTT_REGULAR && mutt_needs_mailcap(a))); snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype); @@ -806,9 +808,13 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE); if (mutt_copy_message_fp(msg->fp, fp, hn, 0, chflags) == 0 && mx_commit_message(msg, &ctx) == 0) + { r = 0; + } else + { r = -1; + } mx_close_message(&ctx, &msg); mx_close_mailbox(&ctx, NULL); diff --git a/bcache.c b/bcache.c index ebc1aa8a5..b276fe0a6 100644 --- a/bcache.c +++ b/bcache.c @@ -253,7 +253,9 @@ int mutt_bcache_list(struct BodyCache *bcache, { if ((mutt_str_strncmp(de->d_name, ".", 1) == 0) || (mutt_str_strncmp(de->d_name, "..", 2) == 0)) + { continue; + } mutt_debug(3, "bcache: list: dir: '%s', id :'%s'\n", bcache->path, de->d_name); diff --git a/browser.c b/browser.c index 54d1eaf46..4fb2ce980 100644 --- a/browser.c +++ b/browser.c @@ -732,7 +732,9 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, if (prefix && *prefix && (mutt_str_strncmp(prefix, de->d_name, mutt_str_strlen(prefix)) != 0)) + { continue; + } if (!((regexec(Mask.regex, de->d_name, 0, NULL, 0) == 0) ^ Mask.not)) continue; @@ -941,10 +943,14 @@ static void browser_highlight_default(struct BrowserState *state, struct Menu *m */ if ((mutt_str_strcmp(state->entry[0].desc, "..") == 0) || (mutt_str_strcmp(state->entry[0].desc, "../") == 0)) + { /* Skip the first entry, unless there's only one entry. */ menu->current = (menu->max > 1); + } else + { menu->current = 0; + } } static void init_menu(struct BrowserState *state, struct Menu *menu, diff --git a/buffy.c b/buffy.c index e335000ac..fa483bf39 100644 --- a/buffy.c +++ b/buffy.c @@ -444,7 +444,9 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st #ifdef USE_SIDEBAR if ((orig_new != tmp->new) || (orig_count != tmp->msg_count) || (orig_unread != tmp->msg_unread) || (orig_flagged != tmp->msg_flagged)) + { mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + } #endif if (!tmp->new) @@ -518,7 +520,9 @@ struct Buffy *mutt_find_mailbox(const char *path) { if (stat(b->path, &tmp_sb) == 0 && sb.st_dev == tmp_sb.st_dev && sb.st_ino == tmp_sb.st_ino) + { return b; + } } return NULL; } @@ -766,7 +770,9 @@ int mutt_buffy_list(void) if (!first && (MuttMessageWindow->cols >= 7) && (pos + strlen(path) >= (size_t) MuttMessageWindow->cols - 7)) + { break; + } if (!first) pos += strlen(strncat(buffylist + pos, ", ", sizeof(buffylist) - 1 - pos)); diff --git a/charset.c b/charset.c index 71376a360..005bd9ac6 100644 --- a/charset.c +++ b/charset.c @@ -254,12 +254,14 @@ void mutt_canonical_charset(char *dest, size_t dlen, const char *name) mutt_str_strfcpy(scratch, in, sizeof(scratch)); for (size_t i = 0; PreferredMIMENames[i].key; i++) + { if ((mutt_str_strcasecmp(scratch, PreferredMIMENames[i].key) == 0) || (mutt_str_strcasecmp(scratch, PreferredMIMENames[i].key) == 0)) { mutt_str_strfcpy(dest, PreferredMIMENames[i].pref, dlen); goto out; } + } mutt_str_strfcpy(dest, scratch, dlen); @@ -643,7 +645,9 @@ bool mutt_check_charset(const char *s, bool strict) { if ((mutt_str_strcasecmp(PreferredMIMENames[i].key, s) == 0) || (mutt_str_strcasecmp(PreferredMIMENames[i].pref, s) == 0)) + { return true; + } } cd = mutt_iconv_open(s, s, 0); diff --git a/commands.c b/commands.c index 9f4cc7ae3..da758661d 100644 --- a/commands.c +++ b/commands.c @@ -510,7 +510,9 @@ void mutt_pipe_message(struct Header *h) buffer[0] = '\0'; if (mutt_get_field(_("Pipe to command: "), buffer, sizeof(buffer), MUTT_CMD) != 0 || !buffer[0]) + { return; + } mutt_expand_path(buffer, sizeof(buffer)); pipe_message(h, buffer, option(OPT_PIPE_DECODE), 0, option(OPT_PIPE_SPLIT), PipeSep); diff --git a/compose.c b/compose.c index 28ff7c055..89e585119 100644 --- a/compose.c +++ b/compose.c @@ -1407,7 +1407,9 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */ fname[0] = 0; if (mutt_get_field(_("New file: "), fname, sizeof(fname), MUTT_FILE) != 0 || !fname[0]) + { continue; + } mutt_expand_path(fname, sizeof(fname)); /* Call to lookup_mime_type () ? maybe later */ diff --git a/conn/tunnel.c b/conn/tunnel.c index 57fcc49f4..26b481a31 100644 --- a/conn/tunnel.c +++ b/conn/tunnel.c @@ -106,7 +106,9 @@ static int tunnel_socket_open(struct Connection *conn) devnull = open("/dev/null", O_RDWR); if (devnull < 0 || dup2(pout[0], STDIN_FILENO) < 0 || dup2(pin[1], STDOUT_FILENO) < 0 || dup2(devnull, STDERR_FILENO) < 0) + { _exit(127); + } close(pin[0]); close(pin[1]); close(pout[0]); diff --git a/copy.c b/copy.c index c45bee5ab..3b4301af4 100644 --- a/copy.c +++ b/copy.c @@ -217,24 +217,34 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, /* note: CH_FROM takes precedence over header weeding. */ if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) && (flags & CH_WEED) && mutt_matches_ignore(buf)) + { continue; + } if ((flags & CH_WEED_DELIVERED) && (mutt_str_strncasecmp("Delivered-To:", buf, 13) == 0)) + { continue; + } if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) && ((mutt_str_strncasecmp("Status:", buf, 7) == 0) || (mutt_str_strncasecmp("X-Status:", buf, 9) == 0))) + { continue; + } if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) && ((mutt_str_strncasecmp("Content-Length:", buf, 15) == 0) || (mutt_str_strncasecmp("Lines:", buf, 6) == 0))) + { continue; + } if ((flags & CH_MIME) && (((mutt_str_strncasecmp("content-", buf, 8) == 0) && ((mutt_str_strncasecmp("transfer-encoding:", buf + 8, 18) == 0) || (mutt_str_strncasecmp("type:", buf + 8, 5) == 0))) || (mutt_str_strncasecmp("mime-version:", buf, 13) == 0))) + { continue; + } if ((flags & CH_UPDATE_REFS) && (mutt_str_strncasecmp("References:", buf, 11) == 0)) continue; if ((flags & CH_UPDATE_IRT) && (mutt_str_strncasecmp("In-Reply-To:", buf, 12) == 0)) diff --git a/curs_lib.c b/curs_lib.c index d0cf44082..b3eda4850 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -1141,9 +1141,13 @@ int mutt_addwch(wchar_t wc) memset(&mbstate, 0, sizeof(mbstate)); if ((n1 = wcrtomb(buf, wc, &mbstate)) == (size_t)(-1) || (n2 = wcrtomb(buf + n1, 0, &mbstate)) == (size_t)(-1)) + { return -1; /* ERR */ + } else + { return addstr(buf); + } } /** diff --git a/curs_main.c b/curs_main.c index 95d04add9..c08216e1f 100644 --- a/curs_main.c +++ b/curs_main.c @@ -264,9 +264,13 @@ static int ci_first_message(void) */ if (((Sort & SORT_REVERSE) && (Sort & SORT_MASK) != SORT_THREADS) || ((Sort & SORT_MASK) == SORT_THREADS && ((Sort ^ SortAux) & SORT_REVERSE))) + { return 0; + } else + { return (Context->vcount ? Context->vcount - 1 : 0); + } } return 0; } @@ -1242,7 +1246,9 @@ int mutt_index_menu(void) buf[0] = 0; if (mutt_get_field(_("Enter Message-Id: "), buf, sizeof(buf), 0) != 0 || !buf[0]) + { break; + } } else { @@ -1541,11 +1547,13 @@ int mutt_index_menu(void) /* try to find what used to be the current message */ menu->current = -1; for (i = 0; i < Context->vcount; i++) + { if (Context->hdrs[Context->v2r[i]]->index == menu->oldcurrent) { menu->current = i; break; } + } if (menu->current < 0) menu->current = 0; } @@ -2163,7 +2171,9 @@ int mutt_index_menu(void) if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } int hint = Context->hdrs[Context->v2r[menu->current]]->index; /* If we are returning to the pager via an index menu redirection, we @@ -2902,7 +2912,9 @@ int mutt_index_menu(void) if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } if (edit) mutt_edit_message(Context, tag ? NULL : CURHDR); else @@ -2918,7 +2930,9 @@ int mutt_index_menu(void) CHECK_ATTACH; if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } ci_send_message(SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; break; @@ -2934,7 +2948,9 @@ int mutt_index_menu(void) CHECK_ATTACH; if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } ci_send_message(SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; break; @@ -2969,7 +2985,9 @@ int mutt_index_menu(void) CHECK_VISIBLE; if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } ci_send_message(SENDREPLY | SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; break; @@ -3158,7 +3176,9 @@ int mutt_index_menu(void) { if (Context && Context->magic == MUTT_NNTP && !((struct NntpData *) Context->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES) + { break; + } if (op == OP_POST) ci_send_message(SENDNEWS, NULL, NULL, Context, NULL); else @@ -3179,7 +3199,9 @@ int mutt_index_menu(void) CHECK_VISIBLE; if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + { mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); + } ci_send_message(SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; break; diff --git a/enter.c b/enter.c index 1b9fab773..a64bd2f6a 100644 --- a/enter.c +++ b/enter.c @@ -209,9 +209,11 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul } if (state->curpos < state->begin || mutt_mb_wcswidth(state->wbuf + state->begin, state->curpos - state->begin) >= width) + { state->begin = mutt_mb_width_ceiling( state->wbuf, state->lastchar, mutt_mb_wcswidth(state->wbuf, state->curpos) - width / 2); + } mutt_window_move(MuttMessageWindow, 0, col); w = 0; for (i = state->begin; i < state->lastchar; i++) diff --git a/from.c b/from.c index 5cfc329e5..030424df9 100644 --- a/from.c +++ b/from.c @@ -153,7 +153,9 @@ int is_from(const char *s, char *path, size_t pathlen, time_t *tp) if ((tm.tm_hour < 0) || (tm.tm_hour > 23) || (tm.tm_min < 0) || (tm.tm_min > 59) || (tm.tm_sec < 0) || (tm.tm_sec > 60)) + { return 0; + } s = mutt_str_next_word(s); if (!*s) diff --git a/handler.c b/handler.c index 766ec2e6b..e81b5d256 100644 --- a/handler.c +++ b/handler.c @@ -717,11 +717,13 @@ static void enriched_set_flags(const wchar_t *tag, struct EnrichedState *stte) tagptr++; for (i = 0, j = -1; EnrichedTags[i].tag_name; i++) + { if (wcscasecmp(EnrichedTags[i].tag_name, tagptr) == 0) { j = EnrichedTags[i].index; break; } + } if (j != -1) { @@ -1266,7 +1268,9 @@ int mutt_can_decode(struct Body *a) { if ((mutt_str_strcasecmp(a->subtype, "signed") == 0) || (mutt_str_strcasecmp(a->subtype, "encrypted") == 0)) + { return 1; + } } for (struct Body *b = a->parts; b; b = b->next) @@ -1339,7 +1343,9 @@ static int multipart_handler(struct Body *a, struct State *s) if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) && (s->flags & MUTT_FIRSTDONE)) + { break; + } } if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED) @@ -1846,9 +1852,13 @@ int mutt_body_handler(struct Body *b, struct State *s) handler = crypt_pgp_application_pgp_handler; else if (option(OPT_REFLOW_TEXT) && (mutt_str_strcasecmp("flowed", mutt_get_parameter("format", b->parameter)) == 0)) + { handler = rfc3676_handler; + } else + { handler = text_plain_handler; + } } else if (mutt_str_strcasecmp("enriched", b->subtype) == 0) handler = text_enriched_handler; @@ -1870,7 +1880,9 @@ int mutt_body_handler(struct Body *b, struct State *s) if ((mutt_str_strcmp("inline", ShowMultipartAlternative) != 0) && (mutt_str_strcasecmp("alternative", b->subtype) == 0)) + { handler = alternative_handler; + } else if (WithCrypto && (mutt_str_strcasecmp("signed", b->subtype) == 0)) { p = mutt_get_parameter("protocol", b->parameter); @@ -1881,9 +1893,13 @@ int mutt_body_handler(struct Body *b, struct State *s) handler = mutt_signed_handler; } else if (mutt_is_valid_multipart_pgp_encrypted(b)) + { handler = valid_pgp_encrypted_handler; + } else if (mutt_is_malformed_multipart_pgp_encrypted(b)) + { handler = malformed_pgp_encrypted_handler; + } if (!handler) handler = multipart_handler; diff --git a/hdrline.c b/hdrline.c index dd9eb2dde..4920adf98 100644 --- a/hdrline.c +++ b/hdrline.c @@ -82,7 +82,9 @@ bool mutt_is_subscribed_list(struct Address *addr) { if (!mutt_match_regex_list(addr->mailbox, UnMailLists) && !mutt_match_regex_list(addr->mailbox, UnSubscribedLists)) + { return mutt_match_regex_list(addr->mailbox, SubscribedLists); + } return false; } @@ -520,7 +522,9 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co case 'K': if (!first_mailing_list(dest, destlen, hdr->env->to) && !first_mailing_list(dest, destlen, hdr->env->cc)) + { dest[0] = 0; + } if (dest[0]) { mutt_str_strfcpy(buf2, dest, sizeof(buf2)); diff --git a/help.c b/help.c index 1bcb0f353..7a7d31089 100644 --- a/help.c +++ b/help.c @@ -73,9 +73,13 @@ void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op) if (km_expand_key(buf, sizeof(buf), km_find_func(menu, op)) || km_expand_key(buf, sizeof(buf), km_find_func(MENU_GENERIC, op))) + { snprintf(d, dlen, "%s:%s", buf, txt); + } else + { d[0] = '\0'; + } } char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items) @@ -130,7 +134,9 @@ static int print_macro(FILE *f, int maxwidth, const char **macro) size_t n1, n2; if ((n1 = wcrtomb(buf, wc, &mbstate2)) != (size_t)(-1) && (n2 = wcrtomb(buf + n1, 0, &mbstate2)) != (size_t)(-1)) + { fputs(buf, f); + } } } else if (wc < 0x20 || wc == 0x7f) diff --git a/history.c b/history.c index 9559f97ad..2875b3877 100644 --- a/history.c +++ b/history.c @@ -232,12 +232,16 @@ static void shrink_histfile(void) } if (!regen_file) + { for (hclass = HC_FIRST; hclass < HC_LAST; hclass++) + { if (n[hclass] > SaveHistory) { regen_file = true; break; } + } + } if (regen_file) { @@ -263,7 +267,9 @@ static void shrink_histfile(void) *p = '\0'; if (option(OPT_HISTORY_REMOVE_DUPS) && (dup_hash_dec(dup_hashes[hclass], linebuf + read) > 0)) + { continue; + } *p = '|'; if (n[hclass]-- <= SaveHistory) fprintf(tmp, "%s\n", linebuf); diff --git a/imap/auth.c b/imap/auth.c index 66f05c6bd..59d3ef54c 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -97,11 +97,13 @@ int imap_authenticate(struct ImapData *idata) { if (!authenticator->method || (mutt_str_strcasecmp(authenticator->method, method) == 0)) + { if ((r = authenticator->authenticate(idata, method)) != IMAP_AUTH_UNAVAIL) { FREE(&methods); return r; } + } authenticator++; } diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index b45be0d61..7059710e1 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -88,20 +88,26 @@ enum ImapAuthRes imap_auth_sasl(struct ImapData *idata, const char *method) if (mutt_bit_isset(idata->capabilities, AUTH_ANON) && (!idata->conn->account.user[0] || (mutt_str_strncmp(idata->conn->account.user, "anonymous", 9) == 0))) + { rc = sasl_client_start(saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, &mech); + } } else if ((mutt_str_strcasecmp("login", method) == 0) && !strstr(NONULL(idata->capstr), "AUTH=LOGIN")) + { /* do not use SASL login for regular IMAP login (#3556) */ return IMAP_AUTH_UNAVAIL; + } if (rc != SASL_OK && rc != SASL_CONTINUE) + { do { rc = sasl_client_start(saslconn, method, &interaction, &pc, &olen, &mech); if (rc == SASL_INTERACT) mutt_sasl_interact(interaction); } while (rc == SASL_INTERACT); + } client_start = (olen > 0); diff --git a/imap/command.c b/imap/command.c index e9a4064cb..9fc697780 100644 --- a/imap/command.c +++ b/imap/command.c @@ -754,7 +754,9 @@ static void cmd_parse_status(struct ImapData *idata, char *s) #ifdef USE_SIDEBAR if ((inc->new != new) || (inc->msg_count != status->messages) || (inc->msg_unread != status->unseen)) + { mutt_set_current_menu_redraw(REDRAW_SIDEBAR); + } #endif inc->new = new; if (new_msg_count) @@ -790,7 +792,9 @@ static void cmd_parse_enabled(struct ImapData *idata, const char *s) { if ((mutt_str_strncasecmp(s, "UTF8=ACCEPT", 11) == 0) || (mutt_str_strncasecmp(s, "UTF8=ONLY", 9) == 0)) + { idata->unicode = 1; + } } } diff --git a/imap/imap.c b/imap/imap.c index 0777c4bdc..b73f2d359 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1062,7 +1062,9 @@ int imap_open_connection(struct ImapData *idata) { if ((mutt_str_strncasecmp("* OK [CAPABILITY", idata->buf, 16) != 0) && check_capabilities(idata)) + { goto bail; + } #ifdef USE_SSL /* Attempt STARTTLS if available and desired. */ if (!idata->conn->ssf && @@ -1074,7 +1076,9 @@ int imap_open_connection(struct ImapData *idata) rc = MUTT_YES; else if ((rc = query_quadoption(OPT_SSL_STARTTLS, _("Secure connection with TLS?"))) == MUTT_ABORT) + { goto err_close_conn; + } if (rc == MUTT_YES) { rc = imap_exec(idata, "STARTTLS", IMAP_CMD_FAIL_OK); @@ -1435,7 +1439,9 @@ int imap_check(struct ImapData *idata, int force) if ((force || (idata->state != IMAP_IDLE && time(NULL) >= idata->lastread + Timeout)) && imap_exec(idata, "NOOP", IMAP_CMD_POLL) != 0) + { return -1; + } /* We call this even when we haven't run NOOP in case we have pending * changes to process, since we can reopen here. */ @@ -2088,7 +2094,9 @@ static int imap_open_mailbox(struct Context *ctx) pmx.mbox = NULL; if (mx_is_imap(Postponed) && !imap_parse_path(Postponed, &pmx) && mutt_account_match(&pmx.account, &mx.account)) + { imap_status(Postponed, 1); + } FREE(&pmx.mbox); snprintf(bufout, sizeof(bufout), "%s %s", diff --git a/imap/message.c b/imap/message.c index d67e1ddd4..8c0cf92aa 100644 --- a/imap/message.c +++ b/imap/message.c @@ -947,7 +947,9 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i if (maxuid && (status = imap_mboxcache_get(idata, idata->mailbox, 0)) && (status->uidnext < maxuid + 1)) + { status->uidnext = maxuid + 1; + } #ifdef USE_HCACHE mutt_hcache_store_raw(idata->hcache, "/UIDVALIDITY", 12, &idata->uid_validity, diff --git a/imap/util.c b/imap/util.c index a2beb8397..1e93176dc 100644 --- a/imap/util.c +++ b/imap/util.c @@ -508,7 +508,9 @@ int imap_mxcmp(const char *mx1, const char *mx2) mx2 = "INBOX"; if ((mutt_str_strcasecmp(mx1, "INBOX") == 0) && (mutt_str_strcasecmp(mx2, "INBOX") == 0)) + { return 0; + } b1 = mutt_mem_malloc(strlen(mx1) + 1); b2 = mutt_mem_malloc(strlen(mx2) + 1); diff --git a/init.c b/init.c index f8e62cce7..51cbeb07a 100644 --- a/init.c +++ b/init.c @@ -1200,7 +1200,9 @@ static int parse_unalternates(struct Buffer *buf, struct Buffer *s, if ((mutt_str_strcmp(buf->data, "*") != 0) && mutt_add_to_regex_list(&UnAlternates, buf->data, REG_ICASE, err) != 0) + { return -1; + } } while (MoreArgs(s)); @@ -1490,10 +1492,14 @@ static int parse_group(struct Buffer *buf, struct Buffer *s, unsigned long data, case GS_RX: if (data == MUTT_GROUP && mutt_group_context_add_regex(gc, buf->data, REG_ICASE, err) != 0) + { goto bail; + } else if (data == MUTT_UNGROUP && mutt_group_context_remove_regex(gc, buf->data) < 0) + { goto bail; + } break; case GS_ADDR: @@ -1785,7 +1791,9 @@ static int parse_unlists(struct Buffer *buf, struct Buffer *s, if ((mutt_str_strcmp(buf->data, "*") != 0) && mutt_add_to_regex_list(&UnMailLists, buf->data, REG_ICASE, err) != 0) + { return -1; + } } while (MoreArgs(s)); return 0; @@ -1832,7 +1840,9 @@ static int parse_unsubscribe(struct Buffer *buf, struct Buffer *s, if ((mutt_str_strcmp(buf->data, "*") != 0) && mutt_add_to_regex_list(&UnSubscribedLists, buf->data, REG_ICASE, err) != 0) + { return -1; + } } while (MoreArgs(s)); return 0; @@ -4221,7 +4231,9 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) /* Do we have a locale definition? */ if (((p = getenv("LC_ALL")) != NULL && p[0]) || ((p = getenv("LANG")) != NULL && p[0]) || ((p = getenv("LC_CTYPE")) != NULL && p[0])) + { OPT_LOCALES = true; + } #endif #ifdef HAVE_GETSID diff --git a/keymap.c b/keymap.c index 0a55a3ae5..f7f4ba84a 100644 --- a/keymap.c +++ b/keymap.c @@ -356,7 +356,9 @@ static int get_op(const struct Binding *bindings, const char *start, size_t len) { if ((mutt_str_strncasecmp(start, bindings[i].name, len) == 0) && mutt_str_strlen(bindings[i].name) == len) + { return bindings[i].op; + } } return OP_NULL; diff --git a/mbox.c b/mbox.c index 18ef95e89..c54d74f3e 100644 --- a/mbox.c +++ b/mbox.c @@ -565,7 +565,9 @@ static int strict_addrcmp(const struct Address *a, const struct Address *b) { if ((mutt_str_strcmp(a->mailbox, b->mailbox) != 0) || (mutt_str_strcmp(a->personal, b->personal) != 0)) + { return 0; + } a = a->next; b = b->next; @@ -612,7 +614,9 @@ static int strict_cmp_parameters(const struct Parameter *p1, const struct Parame { if ((mutt_str_strcmp(p1->attribute, p2->attribute) != 0) || (mutt_str_strcmp(p1->value, p2->value) != 0)) + { return 0; + } p1 = p1->next; p2 = p2->next; @@ -994,7 +998,9 @@ void mbox_reset_atime(struct Context *ctx, struct stat *st) */ if (!option(OPT_MAIL_CHECK_RECENT) && utimebuf.actime >= utimebuf.modtime && mbox_has_new(ctx)) + { utimebuf.actime = utimebuf.modtime - 1; + } utime(ctx->path, &utimebuf); } diff --git a/menu.c b/menu.c index ad614eb5c..661a46c0e 100644 --- a/menu.c +++ b/menu.c @@ -80,7 +80,9 @@ static int get_color(int index, unsigned char *s) const char *transform = mutt_hash_find(TagTransforms, np->pattern); if (transform && (strncmp((const char *) (s + 1), transform, strlen(transform)) == 0)) + { return np->pair; + } } return 0; default: diff --git a/mh.c b/mh.c index 33c3bca8c..139487d7e 100644 --- a/mh.c +++ b/mh.c @@ -249,7 +249,9 @@ static int mh_sequences_changed(struct Buffy *b) if ((snprintf(path, sizeof(path), "%s/.mh_sequences", b->path) < sizeof(path)) && (stat(path, &sb) == 0)) + { return (sb.st_mtime > b->last_visited); + } return -1; } @@ -268,7 +270,9 @@ static int mh_already_notified(struct Buffy *b, int msgno) if ((snprintf(path, sizeof(path), "%s/%d", b->path, msgno) < sizeof(path)) && (stat(path, &sb) == 0)) + { return (sb.st_mtime <= b->last_visited); + } return -1; } @@ -858,7 +862,9 @@ static int maildir_parse_dir(struct Context *ctx, struct Maildir ***last, { if ((ctx->magic == MUTT_MH && !mh_valid_message(de->d_name)) || (ctx->magic == MUTT_MAILDIR && *de->d_name == '.')) + { continue; + } /* FOO - really ignore the return value? */ mutt_debug(2, "%s:%d: queueing %s\n", __FILE__, __LINE__, de->d_name); @@ -1829,8 +1835,10 @@ static int mh_sync_message(struct Context *ctx, int msgno) if (h->attach_del || h->xlabel_changed || (h->env && (h->env->refs_changed || h->env->irt_changed))) + { if (mh_rewrite_message(ctx, msgno) != 0) return -1; + } return 0; } diff --git a/mutt/date.c b/mutt/date.c index cce32cebe..bb8f70ac3 100644 --- a/mutt/date.c +++ b/mutt/date.c @@ -156,9 +156,13 @@ static time_t compute_tz(time_t g, struct tm *utc) /* This code is optimized to negative timezones (West of Greenwich) */ if ((yday == -1) || /* UTC passed midnight before localtime */ (yday > 1)) /* UTC passed new year before localtime */ + { t -= (24 * 60 * 60); + } else + { t += (24 * 60 * 60); + } } return t; @@ -264,7 +268,9 @@ time_t mutt_date_make_time(struct tm *t, int local) return TIME_T_MIN; if ((t->tm_hour < 0) || (t->tm_hour > 23) || (t->tm_min < 0) || (t->tm_min > 59) || (t->tm_sec < 0) || (t->tm_sec > 60)) + { return TIME_T_MIN; + } if (t->tm_year > 9999) return TIME_T_MAX; diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 818496130..dffffe93c 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -480,7 +480,9 @@ static char *get_query_string(struct NmCtxData *data, bool window) */ if (!strstr(data->db_query, "date:") && windowed_query_from_query(data->db_query, buf, sizeof(buf))) + { data->db_query = mutt_str_strdup(buf); + } mutt_debug(2, "nm: query (windowed) '%s'\n", data->db_query); } @@ -2422,7 +2424,9 @@ static int nm_open_message(struct Context *ctx, struct Message *msg, int msgno) msg->fp = fopen(path, "r"); if (!msg->fp && (errno == ENOENT) && ((ctx->magic == MUTT_MAILDIR) || (ctx->magic == MUTT_NOTMUCH))) + { msg->fp = maildir_open_find_message(folder, cur->path, NULL); + } mutt_debug(1, "%s\n", __func__); return !msg->fp; diff --git a/mutt_tags.c b/mutt_tags.c index cd7a3f33e..873b57933 100644 --- a/mutt_tags.c +++ b/mutt_tags.c @@ -160,7 +160,9 @@ static void driver_tags_add(struct TagHead *head, char *new_tag) if (p && ((p == HiddenTags) || (*(p - 1) == ',') || (*(p - 1) == ' ')) && ((*(p + xsz) == '\0') || (*(p + xsz) == ',') || (*(p + xsz) == ' '))) + { np->hidden = true; + } } STAILQ_INSERT_TAIL(head, np, entries); diff --git a/muttlib.c b/muttlib.c index 80ef4ff4d..a306b4f18 100644 --- a/muttlib.c +++ b/muttlib.c @@ -229,7 +229,9 @@ char *mutt_expand_path_regex(char *s, size_t slen, int regex) /* if folder = {host} or imap[s]://host/: don't append slash */ if (mx_is_imap(NONULL(Folder)) && (Folder[strlen(Folder) - 1] == '}' || Folder[strlen(Folder) - 1] == '/')) + { mutt_str_strfcpy(p, NONULL(Folder), sizeof(p)); + } else #endif #ifdef USE_NOTMUCH diff --git a/mx.c b/mx.c index d3883d141..7be1140e8 100644 --- a/mx.c +++ b/mx.c @@ -602,7 +602,9 @@ static int trash_append(struct Context *ctx) if (lstat(ctx->path, &stc) == 0 && stc.st_ino == st.st_ino && stc.st_dev == st.st_dev && stc.st_rdev == st.st_rdev) + { return 0; /* we are in the trash folder: simple sync */ + } #ifdef USE_IMAP if (Context->magic == MUTT_IMAP && mx_is_imap(Trash)) @@ -616,6 +618,7 @@ static int trash_append(struct Context *ctx) { /* continue from initial scan above */ for (; i < ctx->msgcount; i++) + { if (ctx->hdrs[i]->deleted && (!ctx->hdrs[i]->purge)) { if (mutt_append_message(&ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1) @@ -624,6 +627,7 @@ static int trash_append(struct Context *ctx) return -1; } } + } mx_close_mailbox(&ctx_trash, NULL); } @@ -683,7 +687,9 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) { if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read && !(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED))) + { read_msgs++; + } } #ifdef USE_NNTP @@ -760,11 +766,17 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) { /* tag messages for moving, and clear old tags, if any */ for (i = 0; i < ctx->msgcount; i++) + { if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted && !(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED))) + { ctx->hdrs[i]->tagged = true; + } else + { ctx->hdrs[i]->tagged = false; + } + } i = imap_copy_messages(ctx, NULL, mbox, 1); } @@ -873,7 +885,9 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) if (ctx->msgcount == ctx->deleted && (ctx->magic == MUTT_MMDF || ctx->magic == MUTT_MBOX) && !mutt_is_spool(ctx->path) && !option(OPT_SAVE_EMPTY)) + { mutt_file_unlink_empty(ctx->path); + } #ifdef USE_SIDEBAR if (purge && ctx->deleted) diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index d8d678148..b1c68c4d1 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -317,7 +317,9 @@ int mutt_is_multipart_signed(struct Body *b) if (!b || !(b->type == TYPEMULTIPART) || !b->subtype || (mutt_str_strcasecmp(b->subtype, "signed") != 0)) + { return 0; + } p = mutt_get_parameter("protocol", b->parameter); if (!p) @@ -328,14 +330,20 @@ int mutt_is_multipart_signed(struct Body *b) if ((WithCrypto & APPLICATION_PGP) && !(mutt_str_strcasecmp(p, "application/pgp-signature") != 0)) + { return PGPSIGN; + } if ((WithCrypto & APPLICATION_SMIME) && !(mutt_str_strcasecmp(p, "application/x-pkcs7-signature") != 0)) + { return SMIMESIGN; + } if ((WithCrypto & APPLICATION_SMIME) && !(mutt_str_strcasecmp(p, "application/pkcs7-signature") != 0)) + { return SMIMESIGN; + } return 0; } @@ -366,12 +374,16 @@ int mutt_is_valid_multipart_pgp_encrypted(struct Body *b) b = b->parts; if (!b || b->type != TYPEAPPLICATION || !b->subtype || (mutt_str_strcasecmp(b->subtype, "pgp-encrypted") != 0)) + { return 0; + } b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || (mutt_str_strcasecmp(b->subtype, "octet-stream") != 0)) + { return 0; + } return PGPENCRYPT; } @@ -396,22 +408,30 @@ int mutt_is_malformed_multipart_pgp_encrypted(struct Body *b) if (!b || b->type != TYPEMULTIPART || !b->subtype || (mutt_str_strcasecmp(b->subtype, "mixed") != 0)) + { return 0; + } b = b->parts; if (!b || b->type != TYPETEXT || !b->subtype || (mutt_str_strcasecmp(b->subtype, "plain") != 0) || b->length != 0) + { return 0; + } b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || (mutt_str_strcasecmp(b->subtype, "pgp-encrypted") != 0)) + { return 0; + } b = b->next; if (!b || b->type != TYPEAPPLICATION || !b->subtype || (mutt_str_strcasecmp(b->subtype, "octet-stream") != 0)) + { return 0; + } b = b->next; if (b) @@ -437,7 +457,9 @@ int mutt_is_application_pgp(struct Body *m) if ((p = mutt_get_parameter("format", m->parameter)) && (mutt_str_strcasecmp(p, "keys-only") == 0)) + { t |= PGPKEY; + } if (!t) t |= PGPENCRYPT; /* not necessarily correct, but... */ @@ -681,7 +703,9 @@ void convert_to_7bit(struct Body *a) a->encoding = ENCBASE64; else if (a->content && a->encoding != ENCBASE64 && (a->content->from || (a->content->space && option(OPT_PGP_STRICT_ENC)))) + { a->encoding = ENCQUOTEDPRINTABLE; + } a = a->next; } } @@ -964,18 +988,24 @@ int mutt_signed_handler(struct Body *a, struct State *s) case SIGN: if (a->next->type != TYPEMULTIPART || (mutt_str_strcasecmp(a->next->subtype, "mixed") != 0)) + { inconsistent = true; + } break; case PGPSIGN: if (a->next->type != TYPEAPPLICATION || (mutt_str_strcasecmp(a->next->subtype, "pgp-signature") != 0)) + { inconsistent = true; + } break; case SMIMESIGN: if (a->next->type != TYPEAPPLICATION || ((mutt_str_strcasecmp(a->next->subtype, "x-pkcs7-signature") != 0) && (mutt_str_strcasecmp(a->next->subtype, "pkcs7-signature") != 0))) + { inconsistent = true; + } break; default: inconsistent = true; diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 8bb0c6ed5..ee7ca4d6b 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -3347,7 +3347,9 @@ static const char *parse_dn_part(struct DnArray *array, const char *string) s++; if (*s == ',' || *s == '=' || *s == '+' || *s == '<' || *s == '>' || *s == '#' || *s == ';' || *s == '\\' || *s == '\"' || *s == ' ') + { n++; + } else if (isxdigit(*s) && isxdigit(*(s + 1))) { s++; @@ -3360,7 +3362,9 @@ static const char *parse_dn_part(struct DnArray *array, const char *string) return NULL; /* invalid encoding */ else if (*s == ',' || *s == '=' || *s == '+' || *s == '<' || *s == '>' || *s == '#' || *s == ';') + { break; + } else n++; } @@ -4541,11 +4545,13 @@ static struct CryptKeyInfo *crypt_ask_for_key(char *tag, char *whatfor, short ab if (whatfor) { for (l = id_defaults; l; l = l->next) + { if (mutt_str_strcasecmp(whatfor, l->what) == 0) { mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp)); break; } + } } while (true) diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 8cf979a83..71fe7a27e 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -222,7 +222,9 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe if (!(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)) && mutt_str_atos(p, &tmp.keylen) < 0) + { goto bail; + } break; } case 4: /* pubkey algo */ diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 511712e04..705d61f79 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1674,7 +1674,9 @@ int pgp_send_menu(struct Header *msg) /* If autoinline and no crypto options set, then set inline. */ if (option(OPT_PGP_AUTOINLINE) && !((msg->security & APPLICATION_PGP) && (msg->security & (SIGN | ENCRYPT)))) + { msg->security |= INLINE; + } msg->security |= APPLICATION_PGP; diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index d887ac4da..619b70d93 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -438,11 +438,15 @@ static int pgp_id_matches_addr(struct Address *addr, struct Address *u_addr, str if (addr->mailbox && u_addr->mailbox && (mutt_str_strcasecmp(addr->mailbox, u_addr->mailbox) == 0)) + { rv |= PGP_KV_ADDR; + } if (addr->personal && u_addr->personal && (mutt_str_strcasecmp(addr->personal, u_addr->personal) == 0)) + { rv |= PGP_KV_STRING; + } return rv; } @@ -672,11 +676,13 @@ struct PgpKeyInfo *pgp_ask_for_key(char *tag, char *whatfor, short abilities, en if (whatfor) { for (l = id_defaults; l; l = l->next) + { if (mutt_str_strcasecmp(whatfor, l->what) == 0) { mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp)); break; } + } } while (true) diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 2f3ccf52e..e4b8f3806 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -835,17 +835,21 @@ void smime_getkeys(struct Envelope *env) } for (t = env->to; !found && t; t = t->next) + { if (mutt_addr_is_user(t)) { found = true; getkeys(t->mailbox); } + } for (t = env->cc; !found && t; t = t->next) + { if (mutt_addr_is_user(t)) { found = true; getkeys(t->mailbox); } + } if (!found && (t = mutt_default_from())) { getkeys(t->mailbox); diff --git a/newsrc.c b/newsrc.c index 7dcf334da..33b40bd51 100644 --- a/newsrc.c +++ b/newsrc.c @@ -273,7 +273,9 @@ int nntp_newsrc_parse(struct NntpServer *nserv) if (sscanf(b, ANUM, &nntp_data->newsrc_ent[j].first) == 1 && sscanf(h, ANUM, &nntp_data->newsrc_ent[j].last) == 1) + { j++; + } } if (j == 0) { diff --git a/nntp.c b/nntp.c index cdbd14337..9093a025a 100644 --- a/nntp.c +++ b/nntp.c @@ -87,7 +87,9 @@ static int nntp_capabilities(struct NntpServer *nserv) if (mutt_socket_write(conn, "CAPABILITIES\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } /* no capabilities */ if (mutt_str_strncmp("101", buf, 3) != 0) @@ -186,19 +188,25 @@ static int nntp_attempt_features(struct NntpServer *nserv) { if (mutt_socket_write(conn, "DATE\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("500", buf, 3) != 0) nserv->hasDATE = true; if (mutt_socket_write(conn, "LISTGROUP\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("500", buf, 3) != 0) nserv->hasLISTGROUP = true; if (mutt_socket_write(conn, "LIST NEWSGROUPS +\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("500", buf, 3) != 0) nserv->hasLIST_NEWSGROUPS = true; if (mutt_str_strncmp("215", buf, 3) == 0) @@ -216,7 +224,9 @@ static int nntp_attempt_features(struct NntpServer *nserv) { if (mutt_socket_write(conn, "XGTITLE\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("500", buf, 3) != 0) nserv->hasXGTITLE = true; } @@ -226,7 +236,9 @@ static int nntp_attempt_features(struct NntpServer *nserv) { if (mutt_socket_write(conn, "XOVER\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("500", buf, 3) != 0) nserv->hasXOVER = true; } @@ -236,7 +248,9 @@ static int nntp_attempt_features(struct NntpServer *nserv) { if (mutt_socket_write(conn, "LIST OVERVIEW.FMT\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("215", buf, 3) != 0) nserv->overview_fmt = OverviewFmt; else @@ -315,7 +329,9 @@ static int nntp_auth(struct NntpServer *nserv) /* get login and password */ if ((mutt_account_getuser(&conn->account) < 0) || (conn->account.user[0] == '\0') || (mutt_account_getpass(&conn->account) < 0) || (conn->account.pass[0] == '\0')) + { break; + } /* get list of authenticators */ if (NntpAuthenticators && *NntpAuthenticators) @@ -379,7 +395,9 @@ static int nntp_auth(struct NntpServer *nserv) snprintf(buf, sizeof(buf), "AUTHINFO USER %s\r\n", conn->account.user); if (mutt_socket_write(conn, buf) < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { break; + } /* authenticated, password is not required */ if (mutt_str_strncmp("281", buf, 3) == 0) @@ -395,7 +413,9 @@ static int nntp_auth(struct NntpServer *nserv) snprintf(buf, sizeof(buf), "AUTHINFO PASS %s\r\n", conn->account.pass); if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { break; + } /* authenticated */ if (mutt_str_strncmp("281", buf, 3) == 0) @@ -490,7 +510,9 @@ static int nntp_auth(struct NntpServer *nserv) client_len = 0; if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 || mutt_socket_readln_d(inbuf, sizeof(inbuf), conn, MUTT_SOCK_LOG_FULL) < 0) + { break; + } if ((mutt_str_strncmp(inbuf, "283 ", 4) != 0) && (mutt_str_strncmp(inbuf, "383 ", 4) != 0)) { @@ -559,7 +581,9 @@ static int nntp_auth(struct NntpServer *nserv) { if (mutt_socket_write(conn, "*\r\n") < 0 || mutt_socket_readln(inbuf, sizeof(inbuf), conn) < 0) + { break; + } } /* server doesn't support AUTHINFO SASL, trying next method */ @@ -633,7 +657,9 @@ int nntp_open_connection(struct NntpServer *nserv) { if (mutt_socket_write(conn, "MODE READER\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("200", buf, 3) == 0) posting = true; @@ -676,7 +702,9 @@ int nntp_open_connection(struct NntpServer *nserv) { if (mutt_socket_write(conn, "STARTTLS\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("382", buf, 3) != 0) { nserv->use_tls = 0; @@ -713,7 +741,9 @@ int nntp_open_connection(struct NntpServer *nserv) { if (mutt_socket_write(conn, "STAT\r\n") < 0 || mutt_socket_readln(buf, sizeof(buf), conn) < 0) + { return nntp_connect_error(nserv); + } if (mutt_str_strncmp("480", buf, 3) != 0) auth = false; } @@ -797,7 +827,9 @@ static int nntp_query(struct NntpData *nntp_data, char *line, size_t linelen) snprintf(buf, sizeof(buf), "GROUP %s\r\n", nntp_data->group); if (mutt_socket_write(nserv->conn, buf) < 0 || mutt_socket_readln(buf, sizeof(buf), nserv->conn) < 0) + { return nntp_connect_error(nserv); + } } if (!*line) break; diff --git a/pager.c b/pager.c index 96cf4d218..47736413c 100644 --- a/pager.c +++ b/pager.c @@ -2400,7 +2400,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) && !rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0) + { break; + } } if (i < rd.last_line) @@ -2421,7 +2423,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { if ((!rd.hide_quoted || (rd.has_types && rd.line_info[i].type != MT_COLOR_QUOTED)) && !rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0) + { break; + } } if (i >= 0) @@ -2527,7 +2531,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) && !rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0) + { break; + } } if (i < rd.last_line) @@ -2540,7 +2546,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) && !rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0) + { break; + } } if (i >= 0) @@ -2889,7 +2897,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e CHECK_ATTACH; if (extra->ctx && extra->ctx->magic == MUTT_NNTP && !((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES) + { break; + } ci_send_message(SENDNEWS, NULL, NULL, extra->ctx, NULL); pager_menu->redraw = REDRAW_FULL; break; @@ -2899,7 +2909,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e CHECK_ATTACH; if (extra->ctx && extra->ctx->magic == MUTT_NNTP && !((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES) + { break; + } if (IsMsgAttach(extra)) mutt_attach_forward(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDNEWS); else @@ -2922,7 +2934,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { if (extra->ctx && extra->ctx->magic == MUTT_NNTP && !((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES) + { break; + } if (IsMsgAttach(extra)) mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDNEWS | SENDREPLY); diff --git a/parse.c b/parse.c index aa7364267..c815ae288 100644 --- a/parse.c +++ b/parse.c @@ -135,7 +135,9 @@ int mutt_check_encoding(const char *c) return ENCBINARY; else if (mutt_str_strncasecmp("quoted-printable", c, sizeof("quoted-printable") - 1) == 0) + { return ENCQUOTEDPRINTABLE; + } else if (mutt_str_strncasecmp("base64", c, sizeof("base64") - 1) == 0) return ENCBASE64; else if (mutt_str_strncasecmp("x-uuencode", c, sizeof("x-uuencode") - 1) == 0) @@ -856,7 +858,9 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, case 'e': if ((mutt_str_strcasecmp("xpires", line + 1) == 0) && hdr && mutt_date_parse_date(p, NULL) < time(NULL)) + { hdr->expired = true; + } break; case 'f': @@ -1412,7 +1416,9 @@ static int count_body_parts(struct Body *body, int flags) if (bp->disposition == DISPINLINE && bp->type != TYPEMULTIPART && bp->type != TYPEMESSAGE && bp == body) + { shallcount = false; /* ignore fundamental inlines */ + } /* If this body isn't scheduled for enumeration already, don't bother * profiling it further. diff --git a/pattern.c b/pattern.c index 23df1fbbc..1abf3701a 100644 --- a/pattern.c +++ b/pattern.c @@ -1474,10 +1474,14 @@ static int match_threadcomplete(struct Pattern *pat, enum PatternExecFlag flags, return a; if (right && t->parent && (a = match_threadcomplete(pat, flags, ctx, t->next, 0, 0, 1, 1))) + { return a; + } if (left && t->parent && (a = match_threadcomplete(pat, flags, ctx, t->prev, 1, 0, 0, 1))) + { return a; + } if (down && (a = match_threadcomplete(pat, flags, ctx, t->child, 1, 0, 1, 1))) return a; return 0; @@ -1824,7 +1828,9 @@ void mutt_check_simple(char *s, size_t len, const char *simple) /* convert old tokens into the new format */ if ((mutt_str_strcasecmp("all", s) == 0) || (mutt_str_strcmp("^", s) == 0) || (mutt_str_strcmp(".", s) == 0)) /* ~A is more efficient */ + { mutt_str_strfcpy(s, "~A", len); + } else if (mutt_str_strcasecmp("del", s) == 0) mutt_str_strfcpy(s, "~D", len); else if (mutt_str_strcasecmp("flag", s) == 0) diff --git a/pgppubring.c b/pgppubring.c index 5f25ce10d..4af5016c9 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -94,9 +94,13 @@ static void pgpring_dump_signatures(struct PgpSignature *sig) { if (sig->sigtype == 0x10 || sig->sigtype == 0x11 || sig->sigtype == 0x12 || sig->sigtype == 0x13) + { printf("sig::::%08lX%08lX::::::%X:\n", sig->sid1, sig->sid2, sig->sigtype); + } else if (sig->sigtype == 0x20) + { printf("rev::::%08lX%08lX::::::%X:\n", sig->sid1, sig->sid2, sig->sigtype); + } } } diff --git a/pop.c b/pop.c index f5c91212b..436dc5d09 100644 --- a/pop.c +++ b/pop.c @@ -217,9 +217,11 @@ static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data) #endif for (int i = 0; i < ctx->msgcount; i++) + { /* if the id we get is known for a header: done (i.e. keep in cache) */ if (ctx->hdrs[i]->data && (mutt_str_strcmp(ctx->hdrs[i]->data, id) == 0)) return 0; + } /* message not found in context -> remove it from cache * return the result of bcache, so we stop upon its first error diff --git a/pop_auth.c b/pop_auth.c index 0b2cd9796..9b354d945 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -345,7 +345,9 @@ int pop_authenticate(struct PopData *pop_data) if ((mutt_account_getuser(acct) < 0) || (acct->user[0] == '\0') || (mutt_account_getpass(acct) < 0) || (acct->pass[0] == '\0')) + { return -3; + } if (PopAuthenticators && *PopAuthenticators) { @@ -421,7 +423,9 @@ int pop_authenticate(struct PopData *pop_data) attempts++; if (ret == POP_A_SUCCESS || ret == POP_A_SOCKET || (ret == POP_A_FAILURE && !option(OPT_POP_AUTH_TRY_ALL))) + { break; + } authenticator++; } diff --git a/postpone.c b/postpone.c index d76b58fb1..8a3b34287 100644 --- a/postpone.c +++ b/postpone.c @@ -501,11 +501,15 @@ int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app) if ((WithCrypto & APPLICATION_PGP) && (crypt_app == APPLICATION_PGP) && (flags & SIGN) && (set_empty_signas || *sign_as)) + { mutt_str_replace(&PgpSignAs, sign_as); + } if ((WithCrypto & APPLICATION_SMIME) && (crypt_app == APPLICATION_SMIME) && (flags & SIGN) && (set_empty_signas || *sign_as)) + { mutt_str_replace(&SmimeDefaultKey, sign_as); + } return flags; } diff --git a/query.c b/query.c index 23e2c9ca5..3696cc72f 100644 --- a/query.c +++ b/query.c @@ -193,10 +193,14 @@ static int query_search(struct Menu *m, regex_t *re, int n) { if (table[n].data->addr->personal && !regexec(re, table[n].data->addr->personal, 0, NULL, 0)) + { return 0; + } if (table[n].data->addr->mailbox && !regexec(re, table[n].data->addr->mailbox, 0, NULL, 0)) + { return 0; + } } return REG_NOMATCH; @@ -399,12 +403,14 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, int retb struct Address *naddr = NULL; for (i = 0; i < menu->max; i++) + { if (QueryTable[i].tagged) { struct Address *a = result_to_addr(QueryTable[i].data); rfc822_append(&naddr, a, 0); rfc822_free_address(&a); } + } mutt_create_alias(NULL, naddr); rfc822_free_address(&naddr); diff --git a/recvattach.c b/recvattach.c index a2f0ece28..da28008bb 100644 --- a/recvattach.c +++ b/recvattach.c @@ -179,13 +179,17 @@ const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols, { if (mutt_is_text_part(aptr->content) && mutt_get_body_charset(charset, sizeof(charset), aptr->content)) + { mutt_format_s(dest, destlen, prefix, charset); + } else mutt_format_s(dest, destlen, prefix, ""); } else if (!mutt_is_text_part(aptr->content) || !mutt_get_body_charset(charset, sizeof(charset), aptr->content)) + { optional = 0; + } break; case 'c': /* XXX */ @@ -445,7 +449,9 @@ static int query_save_attachment(FILE *fp, struct Body *body, } else if (body->hdr && body->encoding != ENCBASE64 && body->encoding != ENCQUOTEDPRINTABLE && mutt_is_message_type(body->type, body->subtype)) + { mutt_default_save(buf, sizeof(buf), body->hdr); + } else buf[0] = 0; @@ -541,7 +547,9 @@ void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, if (mutt_get_field(_("Save to file: "), buf, sizeof(buf), MUTT_FILE | MUTT_CLEAR) != 0 || !buf[0]) + { return; + } mutt_expand_path(buf, sizeof(buf)); if (mutt_check_overwrite(top->filename, buf, tfile, sizeof(tfile), &append, NULL)) return; @@ -763,7 +771,9 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, { if ((mutt_str_strcasecmp("text/plain", top->subtype) == 0) || (mutt_str_strcasecmp("application/postscript", top->subtype) == 0)) + { pipe_attachment(fp, top, state); + } else if (mutt_can_decode(top)) { /* decode and print */ @@ -1093,9 +1103,13 @@ static void attach_collapse(struct AttachCtx *actx, struct Menu *menu) { if (option(OPT_DIGEST_COLLAPSE) && actx->idx[rindex]->content->type == TYPEMULTIPART && !mutt_str_strcasecmp(actx->idx[rindex]->content->subtype, "digest")) + { actx->idx[rindex]->content->collapsed = true; + } else + { actx->idx[rindex]->content->collapsed = false; + } rindex++; } } diff --git a/recvcmd.c b/recvcmd.c index 7eba9c54b..8ff06b073 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -451,9 +451,13 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx if ((!cur || mutt_can_decode(cur)) && (rc = query_quadoption(OPT_MIME_FORWARD, _("Forward as attachments?"))) == MUTT_YES) + { mime_fwd_all = true; + } else if (rc == -1) + { goto bail; + } /* * shortcut MIMEFWDREST when there is only one attachment. Is @@ -571,11 +575,13 @@ static void attach_forward_msgs(FILE *fp, struct Header *hdr, else { for (short i = 0; i < actx->idxlen; i++) + { if (actx->idx[i]->content->tagged) { curhdr = actx->idx[i]->content->hdr; break; } + } } tmphdr = mutt_new_header(); @@ -643,11 +649,13 @@ static void attach_forward_msgs(FILE *fp, struct Header *hdr, else { for (short i = 0; i < actx->idxlen; i++) + { if (actx->idx[i]->content->tagged) { mutt_copy_body(actx->idx[i]->fp, last, actx->idx[i]->content); last = &((*last)->next); } + } } } else @@ -723,7 +731,9 @@ static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx /* in case followup set Newsgroups: with Followup-To: if it present */ if (!env->newsgroups && curenv && (mutt_str_strcasecmp(curenv->followup_to, "poster") != 0)) + { env->newsgroups = mutt_str_strdup(curenv->followup_to); + } } else #endif @@ -739,7 +749,9 @@ static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx { if (actx->idx[i]->content->tagged && mutt_fetch_recips(env, actx->idx[i]->content->hdr->env, flags) == -1) + { return -1; + } } } diff --git a/rfc2047.c b/rfc2047.c index c451f5ac3..d4ea291b3 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -516,7 +516,9 @@ static int rfc2047_encode(ICONV_CONST char *d, size_t dlen, int col, const char t++; if (!try_block(t0, t - t0, icode, tocode, &encoder, &wlen) && col + (t0 - u) + wlen <= ENCWORD_LEN_MAX + 1) + { break; + } } /* Adjust t1 until we can encode a character before a space. */ @@ -530,7 +532,9 @@ static int rfc2047_encode(ICONV_CONST char *d, size_t dlen, int col, const char t--; if (!try_block(t, t1 - t, icode, tocode, &encoder, &wlen) && 1 + wlen + (u + ulen - t1) <= ENCWORD_LEN_MAX + 1) + { break; + } } /* We shall encode the region [t0,t1). */ @@ -909,7 +913,9 @@ void rfc2047_decode_adrlist(struct Address *a) { if (a->personal && ((strstr(a->personal, "=?") != NULL) || (AssumedCharset && *AssumedCharset))) + { rfc2047_decode(&a->personal); + } else if (a->group && a->mailbox && (strstr(a->mailbox, "=?") != NULL)) rfc2047_decode(&a->mailbox); a = a->next; diff --git a/rfc2231.c b/rfc2231.c index b0ed778b6..df3736808 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -353,13 +353,17 @@ int rfc2231_encode_string(char **pd) sprintf(e, "%s''", charset); t = e + strlen(e); for (s = d, slen = dlen; slen; s++, slen--) + { if (*s < 0x20 || *s >= 0x7f || strchr(MimeSpecials, *s) || strchr("*'%", *s)) { sprintf(t, "%%%02X", (unsigned char) *s); t += 3; } else + { *t++ = *s; + } + } *t = '\0'; if (d != *pd) diff --git a/rfc822.c b/rfc822.c index 254d064db..0bddd1a83 100644 --- a/rfc822.c +++ b/rfc822.c @@ -645,6 +645,7 @@ void rfc822_qualify(struct Address *addr, const char *host) char *p = NULL; for (; addr; addr = addr->next) + { if (!addr->group && addr->mailbox && strchr(addr->mailbox, '@') == NULL) { p = mutt_mem_malloc(mutt_str_strlen(addr->mailbox) + mutt_str_strlen(host) + 2); @@ -652,6 +653,7 @@ void rfc822_qualify(struct Address *addr, const char *host) FREE(&addr->mailbox); addr->mailbox = p; } + } } /** diff --git a/send.c b/send.c index 919129fb4..931a219d6 100644 --- a/send.c +++ b/send.c @@ -272,7 +272,9 @@ static int edit_envelope(struct Envelope *en, int flags) buf[0] = 0; if (option(OPT_ASK_FOLLOW_UP) && mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0) + { return -1; + } FREE(&en->followup_to); en->followup_to = mutt_str_strdup(buf); @@ -282,7 +284,9 @@ static int edit_envelope(struct Envelope *en, int flags) buf[0] = 0; if (option(OPT_X_COMMENT_TO) && option(OPT_ASK_X_COMMENT_TO) && mutt_get_field("X-Comment-To: ", buf, sizeof(buf), 0) != 0) + { return -1; + } FREE(&en->x_comment_to); en->x_comment_to = mutt_str_strdup(buf); } @@ -631,7 +635,9 @@ int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags) if (in->mail_followup_to && hmfupto == MUTT_YES && default_to(&out->cc, in, flags & SENDLISTREPLY, hmfupto) == MUTT_ABORT) + { return -1; /* abort */ + } } else { @@ -756,7 +762,9 @@ static void make_reference_headers(struct Envelope *curenv, discouraged by RFC2822, sect. 3.6.4 */ if (ctx->tagged > 0 && !STAILQ_EMPTY(&env->in_reply_to) && STAILQ_NEXT(STAILQ_FIRST(&env->in_reply_to), entries)) + { mutt_list_free(&env->references); + } } static int envelope_defaults(struct Envelope *env, struct Context *ctx, @@ -801,7 +809,9 @@ static int envelope_defaults(struct Envelope *env, struct Context *ctx, /* in case followup set Newsgroups: with Followup-To: if it present */ if (!env->newsgroups && (mutt_str_strcasecmp(curenv->followup_to, "poster") != 0)) + { env->newsgroups = mutt_str_strdup(curenv->followup_to); + } } else #endif @@ -1520,7 +1530,9 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, { if ((flags & (SENDREPLY | SENDFORWARD)) && ctx && envelope_defaults(msg->env, ctx, cur, flags) == -1) + { goto cleanup; + } if (option(OPT_HDRS)) process_user_recips(msg->env); @@ -1584,7 +1596,9 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, { if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT && (mutt_str_strcasecmp(msg->content->subtype, "plain") == 0)) + { mutt_set_parameter("format", "flowed", &msg->content->parameter); + } } /* $use_from and/or $from might have changed in a send-hook */ @@ -1604,16 +1618,22 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, if (option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) && Editor && (mutt_str_strcmp(Editor, "builtin") != 0)) + { append_signature(tempfp); + } /* include replies/forwarded messages, unless we are given a template */ if (!tempfile && (ctx || !(flags & (SENDREPLY | SENDFORWARD))) && generate_body(tempfp, msg, flags, ctx, cur) == -1) + { goto cleanup; + } if (!option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) && Editor && (mutt_str_strcmp(Editor, "builtin") != 0)) + { append_signature(tempfp); + } } /* @@ -1766,10 +1786,14 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, { if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP) && (cur->security & APPLICATION_PGP)) + { msg->security |= APPLICATION_PGP; + } else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) && (cur->security & APPLICATION_SMIME)) + { msg->security |= APPLICATION_SMIME; + } } /* @@ -1780,11 +1804,17 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, { if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) && option(OPT_SMIME_IS_DEFAULT)) + { msg->security |= APPLICATION_SMIME; + } else if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP)) + { msg->security |= APPLICATION_PGP; + } else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME)) + { msg->security |= APPLICATION_SMIME; + } } } diff --git a/sendlib.c b/sendlib.c index c6a6d255f..28761c6a4 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1258,11 +1258,17 @@ static void set_encoding(struct Body *b, struct Content *info) char *chsname = mutt_get_body_charset(send_charset, sizeof(send_charset), b); if ((info->lobin && (mutt_str_strncasecmp(chsname, "iso-2022", 8) != 0)) || info->linemax > 990 || (info->from && option(OPT_ENCODE_FROM))) + { b->encoding = ENCQUOTEDPRINTABLE; + } else if (info->hibin) + { b->encoding = option(OPT_ALLOW_8BIT) ? ENC8BIT : ENCQUOTEDPRINTABLE; + } else + { b->encoding = ENC7BIT; + } } else if (b->type == TYPEMESSAGE || b->type == TYPEMULTIPART) { @@ -1278,15 +1284,21 @@ static void set_encoding(struct Body *b, struct Content *info) } else if (b->type == TYPEAPPLICATION && (mutt_str_strcasecmp(b->subtype, "pgp-keys") == 0)) + { b->encoding = ENC7BIT; + } else { /* Determine which encoding is smaller */ if (1.33 * (float) (info->lobin + info->hibin + info->ascii) < 3.0 * (float) (info->lobin + info->hibin) + (float) info->ascii) + { b->encoding = ENCBASE64; + } else + { b->encoding = ENCQUOTEDPRINTABLE; + } } } @@ -1484,7 +1496,9 @@ struct Body *mutt_make_file_attach(const char *path) if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand && !option(OPT_MIME_TYPE_QUERY_FIRST)) + { run_mime_type_query(att); + } info = mutt_get_content_info(path, att); if (!info) @@ -1548,7 +1562,9 @@ static bool check_boundary(const char *boundary, struct Body *b) if ((p = mutt_get_parameter("boundary", b->parameter)) && (mutt_str_strcmp(p, boundary) == 0)) + { return true; + } return false; } diff --git a/sidebar.c b/sidebar.c index 7c283a873..1b6938de9 100644 --- a/sidebar.c +++ b/sidebar.c @@ -363,16 +363,22 @@ static void update_entries_visibility(void) if ((i == OpnIndex) || (sbe->buffy->msg_unread > 0) || sbe->buffy->new || (sbe->buffy->msg_flagged > 0)) + { continue; + } if (Context && (mutt_str_strcmp(sbe->buffy->realpath, Context->realpath) == 0)) + { /* Spool directory */ continue; + } if (mutt_list_find(&SidebarWhitelist, sbe->buffy->path) || mutt_list_find(&SidebarWhitelist, sbe->buffy->desc)) + { /* Explicitly asked to be visible */ continue; + } sbe->is_hidden = true; } @@ -827,7 +833,9 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width) SETCOLOR(MT_COLOR_FLAGGED); else if ((ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) && (mutt_str_strcmp(b->path, SpoolFile) == 0)) + { SETCOLOR(MT_COLOR_SB_SPOOLFILE); + } else { if (ColorDefs[MT_COLOR_ORDINARY] != 0) diff --git a/smtp.c b/smtp.c index 167ba7069..63f725c0d 100644 --- a/smtp.c +++ b/smtp.c @@ -697,7 +697,9 @@ int mutt_smtp_send(const struct Address *from, const struct Address *to, /* send the recipient list */ if ((ret = smtp_rcpt_to(conn, to)) || (ret = smtp_rcpt_to(conn, cc)) || (ret = smtp_rcpt_to(conn, bcc))) + { break; + } /* send the message data */ if ((ret = smtp_data(conn, msgfile))) diff --git a/thread.c b/thread.c index 07c54677d..673a08437 100644 --- a/thread.c +++ b/thread.c @@ -226,7 +226,9 @@ static void calculate_visibility(struct Context *ctx, int *max_depth) { if (!tree->visible && tree->deep && tree->subtree_visible < 2 && ((tree->message && hide_top_limited) || (!tree->message && hide_top_missing))) + { tree->deep = false; + } if (!tree->deep && tree->child && tree->subtree_visible) tree = tree->child; else if (tree->next)