From 91655fd95a562931ecd4c8bbf21e4cac3446ba94 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sun, 3 Jun 2018 17:53:10 +0100 Subject: [PATCH] insert {}s Insert {}s where the conditional or body take up more than one line. --- alias.c | 2 ++ attach.c | 4 ++++ browser.c | 18 ++++++++++++++++++ buffy.c | 2 ++ commands.c | 6 ++++++ complete.c | 2 ++ compose.c | 4 ++++ conn/sasl.c | 2 ++ conn/ssl_gnutls.c | 2 ++ copy.c | 6 ++++++ curs_main.c | 18 ++++++++++++++++++ envelope.c | 2 ++ handler.c | 6 ++++++ hcache/lmdb.c | 2 ++ hdrline.c | 14 ++++++++++++++ header.c | 4 ++++ imap/auth_sasl.c | 2 ++ imap/command.c | 4 ++++ imap/imap.c | 8 ++++++++ imap/message.c | 6 ++++++ imap/util.c | 4 ++++ init.c | 6 ++++++ mbox.c | 10 ++++++++++ menu.c | 8 ++++++++ mh.c | 2 ++ mutt/rfc2047.c | 2 ++ mutt_notmuch.c | 12 ++++++++++++ muttlib.c | 12 ++++++++++++ mx.c | 4 ++++ ncrypt/crypt.c | 12 ++++++++++++ ncrypt/crypt_gpgme.c | 37 ++++++++++++++++++++++++++++++++----- ncrypt/gnupgparse.c | 2 ++ ncrypt/pgp.c | 6 ++++++ ncrypt/pgpinvoke.c | 8 ++++++++ ncrypt/pgpkey.c | 6 ++++++ ncrypt/smime.c | 8 ++++++++ newsrc.c | 6 ++++++ nntp.c | 16 ++++++++++++++++ pager.c | 26 ++++++++++++++++++++++++++ parse.c | 8 +++++++- pattern.c | 8 ++++++++ pop.c | 2 ++ postpone.c | 4 ++++ progress.c | 6 ++++++ recvattach.c | 10 ++++++++++ recvcmd.c | 8 ++++++++ rfc1524.c | 2 ++ score.c | 2 ++ send.c | 8 ++++++++ sendlib.c | 4 ++++ sidebar.c | 6 ++++++ smtp.c | 2 ++ state.c | 2 ++ status.c | 2 ++ thread.c | 12 ++++++++++++ 55 files changed, 381 insertions(+), 6 deletions(-) diff --git a/alias.c b/alias.c index 1a73faf5e..6ddbba65d 100644 --- a/alias.c +++ b/alias.c @@ -589,8 +589,10 @@ int mutt_alias_complete(char *buf, size_t buflen) if (a->name && strncmp(a->name, buf, strlen(buf)) == 0) { if (!bestname[0]) /* init */ + { mutt_str_strfcpy(bestname, a->name, MIN(mutt_str_strlen(a->name) + 1, sizeof(bestname))); + } else { int i; diff --git a/attach.c b/attach.c index 6892e9ec4..df6e7474d 100644 --- a/attach.c +++ b/attach.c @@ -510,11 +510,15 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, if (use_pager) { if (a->description) + { snprintf(descrip, sizeof(descrip), _("---Command: %-20.20s Description: %s"), command, a->description); + } else + { snprintf(descrip, sizeof(descrip), _("---Command: %-30.30s Attachment: %s"), command, type); + } } if ((mutt_wait_filter(thepid) || (entry->needsterminal && WaitKey)) && !use_pager) diff --git a/browser.c b/browser.c index 38418f7b8..9d2767955 100644 --- a/browser.c +++ b/browser.c @@ -630,11 +630,15 @@ static const char *group_index_format_str(char *buf, size_t buflen, size_t col, if (flags & MUTT_FORMAT_OPTIONAL) { if (folder->ff->nd->unread != 0) + { mutt_expando_format(buf, buflen, col, cols, if_str, group_index_format_str, data, flags); + } else + { mutt_expando_format(buf, buflen, col, cols, else_str, group_index_format_str, data, flags); + } } else if (Context && Context->data == folder->ff->nd) { @@ -732,7 +736,9 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, continue; if (Mask && Mask->regex && !((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not)) + { continue; + } add_folder(menu, state, nntp_data->group, NULL, NULL, NULL, nntp_data); } } @@ -791,7 +797,9 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, } if (Mask && Mask->regex && !((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not)) + { continue; + } mutt_file_concat_path(buffer, d, de->d_name, sizeof(buffer)); if (lstat(buffer, &s) == -1) @@ -973,14 +981,18 @@ static void folder_entry(char *buf, size_t buflen, struct Menu *menu, int num) #ifdef USE_NNTP if (OptNews) + { mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(GroupIndexFormat), group_index_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); + } else #endif + { mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); + } } #ifdef USE_NOTMUCH @@ -1048,8 +1060,10 @@ static void init_menu(struct BrowserState *state, struct Menu *menu, if (buffy) snprintf(title, titlelen, _("Subscribed newsgroups")); else + { snprintf(title, titlelen, _("Newsgroups on server [%s]"), CurrentNewsSrv->conn->account.host); + } } else #endif @@ -1428,8 +1442,10 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi } #endif else + { mutt_file_concat_path(buf, LastDir, state.entry[menu->current].name, sizeof(buf)); + } if ((mx_get_magic(buf) <= 0) #ifdef USE_IMAP @@ -1677,8 +1693,10 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi FREE(&((state.entry)[nentry].desc)); /* and move all other entries up */ if (nentry + 1 < state.entrylen) + { memmove(state.entry + nentry, state.entry + nentry + 1, sizeof(struct FolderFile) * (state.entrylen - (nentry + 1))); + } memset(&state.entry[state.entrylen - 1], 0, sizeof(struct FolderFile)); state.entrylen--; mutt_message(_("Mailbox deleted.")); diff --git a/buffy.c b/buffy.c index 3b256748c..91f5f009d 100644 --- a/buffy.c +++ b/buffy.c @@ -308,9 +308,11 @@ static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_s if (CheckMboxSize) new_or_changed = sb->st_size > mailbox->size; else + { new_or_changed = sb->st_mtime > sb->st_atime || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); + } if (new_or_changed) { diff --git a/commands.c b/commands.c index 5c1d5ef5b..773d55c7e 100644 --- a/commands.c +++ b/commands.c @@ -549,8 +549,10 @@ void mutt_print_message(struct Header *h) if (pipe_message(h, PrintCommand, PrintDecode, 1, PrintSplit, "\f") == 0) mutt_message(ngettext("Message printed", "Messages printed", msgcount)); else + { mutt_message(ngettext("Message could not be printed", "Messages could not be printed", msgcount)); + } } int mutt_select_sort(int reverse) @@ -718,7 +720,9 @@ static void set_copy_flags(struct Header *hdr, int decode, int decrypt, } else if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(hdr->content) & ENCRYPT) + { decode = 1; + } else if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(hdr->content) & ENCRYPT) { @@ -866,7 +870,9 @@ int mutt_save_message(struct Header *h, int delete, int decode, int decrypt) if ((WithCrypto != 0) && need_passphrase && (decode || decrypt) && !crypt_valid_passphrase(app)) + { return -1; + } mutt_message(_("Copying to %s..."), buf); diff --git a/complete.c b/complete.c index 938d7d136..f084fd78e 100644 --- a/complete.c +++ b/complete.c @@ -261,8 +261,10 @@ int mutt_complete(char *buf, size_t buflen) tmp[0] = 0; mutt_str_strfcpy(tmp + strlen(tmp), filepart, sizeof(tmp) - strlen(tmp)); if (stat(tmp, &st) != -1 && (st.st_mode & S_IFDIR)) + { mutt_str_strfcpy(filepart + strlen(filepart), "/", sizeof(filepart) - strlen(filepart)); + } init = 1; } } diff --git a/compose.c b/compose.c index 27ef0bc68..ee138b95a 100644 --- a/compose.c +++ b/compose.c @@ -1279,12 +1279,16 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, if (mutt_enter_fname_full(prompt, fname, sizeof(fname), 0, 1, &files, &numfiles, MUTT_SEL_MULTI) == -1 || *fname == '\0') + { break; + } int error = 0; if (numfiles > 1) + { mutt_message(ngettext("Attaching selected file...", "Attaching selected files...", numfiles)); + } for (i = 0; i < numfiles; i++) { char *att = files[i]; diff --git a/conn/sasl.c b/conn/sasl.c index 9934e771a..30aa0b744 100644 --- a/conn/sasl.c +++ b/conn/sasl.c @@ -481,8 +481,10 @@ static int mutt_sasl_conn_write(struct Connection *conn, const char *buf, size_t } while (len > *sasldata->pbufsize); } else + { /* just write using the underlying socket function */ rc = (sasldata->msasl_write)(conn, buf, len); + } conn->sockdata = sasldata; diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index ce049edec..4c0438093 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -454,7 +454,9 @@ static int tls_check_preauth(const gnutls_datum_t *certdata, if (chainidx == 0 && SslVerifyHost != MUTT_NO && !gnutls_x509_crt_check_hostname(cert, hostname) && !tls_check_stored_hostname(certdata, hostname)) + { *certerr |= CERTERR_HOSTNAME; + } /* see whether certificate is in our cache (certificates file) */ if (tls_compare_certificates(certdata)) diff --git a/copy.c b/copy.c index f6d9ef6b2..ebe6c155e 100644 --- a/copy.c +++ b/copy.c @@ -128,11 +128,15 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, 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_UPDATE_REFS) && (mutt_str_strncasecmp("References:", buf, 11) == 0)) continue; if ((flags & CH_UPDATE_IRT) && (mutt_str_strncasecmp("In-Reply-To:", buf, 12) == 0)) @@ -400,8 +404,10 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const char *prefix) { if (h->env) + { flags |= (h->env->irt_changed ? CH_UPDATE_IRT : 0) | (h->env->refs_changed ? CH_UPDATE_REFS : 0); + } if (mutt_copy_hdr(in, out, h->offset, h->content->offset, flags, prefix) == -1) return -1; diff --git a/curs_main.c b/curs_main.c index 671ae2755..fced31ee3 100644 --- a/curs_main.c +++ b/curs_main.c @@ -917,8 +917,10 @@ int mutt_index_menu(void) { /* notify the user of new mail */ if (check == MUTT_REOPENED) + { mutt_error( _("Mailbox was externally modified. Flags may be wrong.")); + } else if (check == MUTT_NEW_MAIL) { for (i = oldcount; i < Context->msgcount; i++) @@ -1008,8 +1010,10 @@ int mutt_index_menu(void) else if (BrailleFriendly) mutt_window_move(MuttIndexWindow, menu->current - menu->top + menu->offset, 0); else + { mutt_window_move(MuttIndexWindow, menu->current - menu->top + menu->offset, MuttIndexWindow->cols - 1); + } mutt_refresh(); if (SigWinch) @@ -2189,8 +2193,10 @@ int mutt_index_menu(void) menu->redraw |= REDRAW_INDEX; } else + { mutt_error( _("Thread cannot be broken, message is not part of a thread")); + } break; @@ -2434,16 +2440,22 @@ int mutt_index_menu(void) if ((op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW || op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD) && first_new != -1) + { break; + } } if ((op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW || op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD) && first_new != -1) + { menu->current = first_new; + } else if ((op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_PREV_UNREAD || op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD) && first_unread != -1) + { menu->current = first_unread; + } if (menu->current == -1) { @@ -2499,8 +2511,10 @@ int mutt_index_menu(void) for (j = 0; j < Context->msgcount; j++) { if (message_is_tagged(Context, j)) + { mutt_set_flag(Context, Context->hdrs[j], MUTT_FLAG, !Context->hdrs[j]->flagged); + } } menu->redraw |= REDRAW_INDEX; @@ -3087,9 +3101,11 @@ int mutt_index_menu(void) } } else + { /* L10N: This error is printed if cannot find a Message-ID for the currently selected message in the index. */ mutt_error(_("No message ID to macro.")); + } break; case OP_RECALL_MESSAGE: @@ -3237,8 +3253,10 @@ int mutt_index_menu(void) rc = mutt_thread_set_flag(CURHDR, MUTT_DELETE, 0, op == OP_UNDELETE_THREAD ? 0 : 1); if (rc != -1) + { rc = mutt_thread_set_flag(CURHDR, MUTT_PURGE, 0, op == OP_UNDELETE_THREAD ? 0 : 1); + } if (rc != -1) { if (Resolve) diff --git a/envelope.c b/envelope.c index 0218fae45..f2576c12b 100644 --- a/envelope.c +++ b/envelope.c @@ -174,7 +174,9 @@ bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2) !mutt_addr_cmp_strict(e1->reply_to, e2->reply_to) || !mutt_addr_cmp_strict(e1->to, e2->to) || !mutt_addr_cmp_strict(e1->cc, e2->cc) || !mutt_addr_cmp_strict(e1->return_path, e2->return_path)) + { return false; + } else return true; } diff --git a/handler.c b/handler.c index 9490b53e8..3d1114778 100644 --- a/handler.c +++ b/handler.c @@ -719,7 +719,9 @@ static int message_handler(struct Body *a, struct State *s) if ((a->encoding == ENCBASE64) || (a->encoding == ENCQUOTEDPRINTABLE) || (a->encoding == ENCUUENCODED)) + { mutt_body_free(&b); + } return rc; } @@ -1251,7 +1253,9 @@ static int multipart_handler(struct Body *a, struct State *s) if ((a->encoding == ENCBASE64) || (a->encoding == ENCQUOTEDPRINTABLE) || (a->encoding == ENCUUENCODED)) + { mutt_body_free(&b); + } /* make failure of a single part non-fatal */ if (rc < 0) @@ -1651,8 +1655,10 @@ int mutt_body_handler(struct Body *b, struct State *s) else { if (HonorDisposition && (b->disposition == DISPATTACH)) + { str = _("[-- This is an attachment (need 'view-attachments' bound to " "key!) --]\n"); + } else { /* L10N: %s/%s is a MIME type, e.g. "text/plain". */ diff --git a/hcache/lmdb.c b/hcache/lmdb.c index a5c9fa3e7..b968b4037 100644 --- a/hcache/lmdb.c +++ b/hcache/lmdb.c @@ -80,8 +80,10 @@ static int mdb_get_r_txn(struct HcacheLmdbCtx *ctx) if (rc == MDB_SUCCESS) ctx->txn_mode = TXN_READ; else + { mutt_debug(2, "%s: %s\n", ctx->txn ? "mdb_txn_renew" : "mdb_txn_begin", mdb_strerror(rc)); + } return rc; } diff --git a/hdrline.c b/hdrline.c index ea98c050e..de4d3be47 100644 --- a/hdrline.c +++ b/hdrline.c @@ -523,8 +523,10 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'a': colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR); if (hdr->env->from && hdr->env->from->mailbox) + { mutt_format_s(buf + colorlen, buflen - colorlen, prec, mutt_addr_for_display(hdr->env->from)); + } else mutt_format_s(buf + colorlen, buflen - colorlen, prec, ""); add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX); @@ -883,11 +885,15 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co { char *parent_tags = NULL; if (hdr->thread->prev && hdr->thread->prev->message) + { parent_tags = driver_tags_get_transformed(&hdr->thread->prev->message->tags); + } if (!parent_tags && hdr->thread->parent && hdr->thread->parent->message) + { parent_tags = driver_tags_get_transformed(&hdr->thread->parent->message->tags); + } if (parent_tags && mutt_str_strcasecmp(tags, parent_tags) == 0) i = 0; FREE(&parent_tags); @@ -1140,8 +1146,10 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'W': if (!optional) + { mutt_format_s(buf, buflen, prec, hdr->env->organization ? hdr->env->organization : ""); + } else if (!hdr->env->organization) optional = 0; break; @@ -1149,8 +1157,10 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co #ifdef USE_NNTP case 'x': if (!optional) + { mutt_format_s(buf, buflen, prec, hdr->env->x_comment_to ? hdr->env->x_comment_to : ""); + } else if (!hdr->env->x_comment_to) optional = 0; break; @@ -1342,11 +1352,15 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co } if (optional) + { mutt_expando_format(buf, buflen, col, cols, if_str, index_format_str, (unsigned long) hfi, flags); + } else if (flags & MUTT_FORMAT_OPTIONAL) + { mutt_expando_format(buf, buflen, col, cols, else_str, index_format_str, (unsigned long) hfi, flags); + } return src; } diff --git a/header.c b/header.c index 1b3f2c42a..3d66f6e86 100644 --- a/header.c +++ b/header.c @@ -128,11 +128,15 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, #ifdef USE_NNTP if (!OptNewsSend) #endif + { if (!STAILQ_EMPTY(&msg->env->in_reply_to) && (STAILQ_EMPTY(&n->in_reply_to) || (mutt_str_strcmp(STAILQ_FIRST(&n->in_reply_to)->data, STAILQ_FIRST(&msg->env->in_reply_to)->data) != 0))) + { mutt_list_free(&msg->env->references); + } + } /* restore old info. */ mutt_list_free(&n->references); diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 458c232e6..b300581bd 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -112,9 +112,11 @@ enum ImapAuthRes imap_auth_sasl(struct ImapData *idata, const char *method) if (method) mutt_debug(2, "%s unavailable\n", method); else + { mutt_debug( 1, "Failure starting authentication exchange. No shared mechanisms?\n"); + } /* SASL doesn't support LOGIN, so fall back */ return IMAP_AUTH_UNAVAIL; diff --git a/imap/command.c b/imap/command.c index 9faf12bff..0322194f3 100644 --- a/imap/command.c +++ b/imap/command.c @@ -760,9 +760,11 @@ static void cmd_parse_status(struct ImapData *idata, char *s) inc->msg_unread = status->unseen; if (inc->new) + { /* force back to keep detecting new mail until the mailbox is opened */ status->uidnext = oldun; + } FREE(&value); return; @@ -976,7 +978,9 @@ int imap_cmd_step(struct ImapData *idata) if (((mutt_str_strncmp(idata->buf, "* ", 2) == 0) || (mutt_str_strncmp(imap_next_word(idata->buf), "OK [", 4) == 0)) && cmd_handle_untagged(idata)) + { return IMAP_CMD_BAD; + } /* server demands a continuation response from us */ if (idata->buf[0] == '+') diff --git a/imap/imap.c b/imap/imap.c index 7d408d7b5..14951a948 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1482,11 +1482,15 @@ int imap_buffy_check(int check_stats) imap_munge_mbox_name(idata, munged, sizeof(munged), name); if (check_stats) + { snprintf(command, sizeof(command), "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged); + } else + { snprintf(command, sizeof(command), "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged); + } if (imap_exec(idata, command, IMAP_CMD_QUEUE | IMAP_CMD_POLL) < 0) { @@ -1547,9 +1551,11 @@ int imap_status(char *path, int queue) imap_unmunge_mbox_name(idata, mbox); } else + { /* Server does not support STATUS, and this is not the current mailbox. * There is no lightweight way to check recent arrivals */ return -1; + } if (queue) { @@ -2166,7 +2172,9 @@ static int imap_mbox_open(struct Context *ctx) mutt_bit_isset(idata->ctx->rights, MUTT_ACL_SEEN) || mutt_bit_isset(idata->ctx->rights, MUTT_ACL_WRITE) || mutt_bit_isset(idata->ctx->rights, MUTT_ACL_INSERT))) + { ctx->readonly = true; + } ctx->hdrmax = count; ctx->hdrs = mutt_mem_calloc(count, sizeof(struct Header *)); diff --git a/imap/message.c b/imap/message.c index 72d813828..b35dc4259 100644 --- a/imap/message.c +++ b/imap/message.c @@ -942,8 +942,10 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i idata->uidnext = maxuid + 1; } if (idata->uidnext > 1) + { mutt_hcache_store_raw(idata->hcache, "/UIDNEXT", 8, &idata->uidnext, sizeof(idata->uidnext)); + } imap_hcache_close(idata); #endif /* USE_HCACHE */ @@ -1076,8 +1078,10 @@ int imap_msg_open(struct Context *ctx, struct Message *msg, int msgno) if (mutt_str_atoui(pc, &uid) < 0) goto bail; if (uid != HEADER_DATA(h)->uid) + { mutt_error(_( "The message index is incorrect. Try reopening the mailbox.")); + } } else if ((mutt_str_strncasecmp("RFC822", pc, 6) == 0) || (mutt_str_strncasecmp("BODY[]", pc, 6) == 0)) @@ -1447,8 +1451,10 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de goto out; } else + { mutt_message(ngettext("Copying %d message to %s...", "Copying %d messages to %s...", rc), rc, mbox); + } } else { diff --git a/imap/util.c b/imap/util.c index 2d88f5117..16cdc9623 100644 --- a/imap/util.c +++ b/imap/util.c @@ -406,8 +406,10 @@ int imap_parse_path(const char *path, struct ImapMbox *mx) if (!c) return -1; else + { /* walk past closing '}' */ mx->mbox = mutt_str_strdup(c + 1); + } c = strrchr(tmp, '@'); if (c) @@ -519,9 +521,11 @@ void imap_pretty_mailbox(char *path) if (hlen == 0) home_match = true; else if (ImapDelimChars) + { for (delim = ImapDelimChars; *delim != '\0'; delim++) if (target.mbox[hlen] == *delim) home_match = true; + } } FREE(&home.mbox); } diff --git a/init.c b/init.c index 2abbffb8f..955bf82ed 100644 --- a/init.c +++ b/init.c @@ -2109,9 +2109,11 @@ static int parse_set(struct Buffer *buf, struct Buffer *s, unsigned long data, else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE) free_mbtable((struct MbTable **) MuttVars[idx].var); else + { /* MuttVars[idx].var is already 'char**' (or some 'void**') or... * so cast to 'void*' is okay */ FREE((void *) MuttVars[idx].var); + } } else if (query || *s->dptr != '=') { @@ -2416,8 +2418,10 @@ static int parse_set(struct Buffer *buf, struct Buffer *s, unsigned long data, else { if (inv) + { *(unsigned char *) MuttVars[idx].var = toggle_quadoption(*(unsigned char *) MuttVars[idx].var); + } else if (unset) *(unsigned char *) MuttVars[idx].var = MUTT_NO; else @@ -3454,7 +3458,9 @@ int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags) (ch == '=' && (flags & MUTT_TOKEN_EQUAL)) || (ch == ';' && !(flags & MUTT_TOKEN_SEMICOLON)) || ((flags & MUTT_TOKEN_PATTERN) && strchr("~%=!|", ch))) + { break; + } } tok->dptr++; diff --git a/mbox.c b/mbox.c index 128ec2e79..b37fd7b8f 100644 --- a/mbox.c +++ b/mbox.c @@ -306,8 +306,10 @@ static int mbox_parse_mailbox(struct Context *ctx) count++; if (!ctx->quiet) + { mutt_progress_update(&progress, count, (int) (ftello(ctx->fp) / (ctx->size / 100 + 1))); + } if (ctx->msgcount == ctx->hdrmax) mx_alloc_memory(ctx); @@ -393,8 +395,10 @@ static int mbox_parse_mailbox(struct Context *ctx) ctx->msgcount++; if (!curhdr->env->return_path && return_path[0]) + { curhdr->env->return_path = mutt_addr_parse_list(curhdr->env->return_path, return_path); + } if (!curhdr->env->from) curhdr->env->from = mutt_addr_copy_list(curhdr->env->return_path, false); @@ -588,7 +592,9 @@ static int strict_cmp_bodies(const struct Body *b1, const struct Body *b2) (mutt_str_strcmp(b1->subtype, b2->subtype) != 0) || (mutt_str_strcmp(b1->description, b2->description) != 0) || !mutt_param_cmp_strict(&b1->parameter, &b2->parameter) || b1->length != b2->length) + { return 0; + } return 1; } @@ -606,7 +612,9 @@ int mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2) h1->zoccident != h2->zoccident || h1->mime != h2->mime || !mutt_env_cmp_strict(h1->env, h2->env) || !strict_cmp_bodies(h1->content, h2->content)) + { return 0; + } else return 1; } @@ -1321,9 +1329,11 @@ bail: /* Come here in case of disaster */ } if (need_sort) + { /* if the mailbox was reopened, the thread tree will be invalid so make * sure to start threading from scratch. */ mutt_sort_headers(ctx, (need_sort == MUTT_REOPENED)); + } return rc; } diff --git a/menu.c b/menu.c index 51ba73809..0f5211733 100644 --- a/menu.c +++ b/menu.c @@ -513,12 +513,16 @@ void menu_check_recenter(struct Menu *menu) else { if (menu->current < menu->top + c) + { menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c; + } else if ((menu->current >= menu->top + menu->pagelen - c)) + { menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c; + } } } @@ -937,7 +941,9 @@ static int menu_search(struct Menu *menu, int op) _("Reverse search for: "), buf, sizeof(buf), MUTT_CLEAR) != 0 || !buf[0]) + { return -1; + } if (menu->menu >= 0 && menu->menu < MENU_MAX) { mutt_str_replace(&SearchBuffers[menu->menu], buf); @@ -1120,8 +1126,10 @@ int mutt_menu_loop(struct Menu *menu) else if (BrailleFriendly) mutt_window_move(menu->indexwin, menu->current - menu->top + menu->offset, 0); else + { mutt_window_move(menu->indexwin, menu->current - menu->top + menu->offset, menu->indexwin->cols - 1); + } mutt_refresh(); diff --git a/mh.c b/mh.c index b6be89bdb..c56fff418 100644 --- a/mh.c +++ b/mh.c @@ -1755,8 +1755,10 @@ static int mh_commit_msg(struct Context *ctx, struct Message *msg, } } if (updseq) + { mh_sequences_add_one(ctx, hi, !msg->flags.read, msg->flags.flagged, msg->flags.replied); + } return 0; } diff --git a/mutt/rfc2047.c b/mutt/rfc2047.c index 6a6893c38..e9478cc9a 100644 --- a/mutt/rfc2047.c +++ b/mutt/rfc2047.c @@ -239,7 +239,9 @@ static size_t try_block(const char *d, size_t dlen, const char *fromcode, assert(strchr(MimeSpecials, '?')); if ((c >= 0x7f) || (c < 0x20) || (*p == '_') || ((c != ' ') && strchr(MimeSpecials, *p))) + { count++; + } } len = ENCWORD_LEN_MIN - 2 + strlen(tocode); diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 21e13d9cd..d71e7cfe3 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -318,7 +318,9 @@ static bool query_window_check_timebase(const char *timebase) if ((strcmp(timebase, "hour") == 0) || (strcmp(timebase, "day") == 0) || (strcmp(timebase, "week") == 0) || (strcmp(timebase, "month") == 0) || (strcmp(timebase, "year") == 0)) + { return true; + } return false; } @@ -402,11 +404,15 @@ static bool windowed_query_from_query(const char *query, char *buf, size_t bufle } if (end == 0) + { snprintf(buf, buflen, "date:%d%s..now and %s", beg, NmQueryWindowTimebase, NmQueryWindowCurrentSearch); + } else + { snprintf(buf, buflen, "date:%d%s..%d%s and %s", beg, NmQueryWindowTimebase, end, NmQueryWindowTimebase, NmQueryWindowCurrentSearch); + } mutt_debug(2, "nm: %s -> %s\n", query, buf); @@ -1048,8 +1054,10 @@ static void progress_update(struct Context *ctx, notmuch_query_t *q) } if (data->progress_ready) + { mutt_progress_update(&data->progress, ctx->msgcount + data->ignmsgcount - data->oldmsgcount, -1); + } } /** @@ -1888,11 +1896,15 @@ char *nm_uri_from_query(struct Context *ctx, char *buf, size_t buflen) } } else if (NmDefaultUri) + { added = snprintf(uri, sizeof(uri), "%s?type=%s&query=", NmDefaultUri, query_type_to_string(string_to_query_type(NmQueryType))); + } else if (Folder) + { added = snprintf(uri, sizeof(uri), "notmuch://%s?type=%s&query=", Folder, query_type_to_string(string_to_query_type(NmQueryType))); + } else return NULL; diff --git a/muttlib.c b/muttlib.c index fe6847ac1..e557548fa 100644 --- a/muttlib.c +++ b/muttlib.c @@ -319,8 +319,10 @@ char *mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw) if (GecosMask && GecosMask->regex) { if (regexec(GecosMask->regex, pw->pw_gecos, 1, pat_match, 0) == 0) + { mutt_str_strfcpy(dest, pw->pw_gecos + pat_match[0].rm_so, MIN(pat_match[0].rm_eo - pat_match[0].rm_so + 1, destlen)); + } } else if ((p = strchr(pw->pw_gecos, ','))) mutt_str_strfcpy(dest, pw->pw_gecos, MIN(destlen, p - pw->pw_gecos + 1)); @@ -475,14 +477,18 @@ void mutt_mktemp_full(char *s, size_t slen, const char *prefix, NONULL(prefix), NONULL(ShortHostname), (int) getuid(), (int) getpid(), mutt_rand64(), suffix ? "." : "", NONULL(suffix)); if (n >= slen) + { mutt_debug(1, "%s:%d: ERROR: insufficient buffer space to hold temporary " "filename! slen=%zu but need %zu\n", src, line, slen, n); + } mutt_debug(3, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s); if (unlink(s) && errno != ENOENT) + { mutt_debug(1, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror(errno), errno); + } } /** @@ -675,7 +681,9 @@ int mutt_check_overwrite(const char *attname, const char *path, char *fname, if (mutt_get_field(_("File under directory: "), tmp, sizeof(tmp), MUTT_FILE | MUTT_CLEAR) != 0 || !tmp[0]) + { return -1; + } mutt_file_concat_path(fname, path, tmp, flen); } @@ -803,11 +811,13 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c for (char *p = tmp; p && *p; p++) { if (*p == '\'') + { /* shell quoting doesn't permit escaping a single quote within * single-quoted material. double-quoting instead will lead * shell variable expansions, so break out of the single-quoted * span, insert a double-quoted single quote, and resume. */ mutt_buffer_addstr(command, "'\"'\"'"); + } else mutt_buffer_addch(command, *p); } @@ -1537,9 +1547,11 @@ int mutt_inbox_cmp(const char *a, const char *b) { /* fast-track in case the paths have been mutt_pretty_mailbox'ified */ if (a[0] == '=' && b[0] == '=') + { return (mutt_str_strcasecmp(a + 1, "inbox") == 0) ? -1 : (mutt_str_strcasecmp(b + 1, "inbox") == 0) ? 1 : 0; + } const char *a_end = strrchr(a, '/'); const char *b_end = strrchr(b, '/'); diff --git a/mx.c b/mx.c index b25d61c43..1dd407272 100644 --- a/mx.c +++ b/mx.c @@ -920,8 +920,10 @@ int mx_mbox_close(struct Context *ctx, int *index_hint) if (!ctx->quiet) { if (move_messages) + { mutt_message(_("%d kept, %d moved, %d deleted."), ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted); + } else mutt_message(_("%d kept, %d deleted."), ctx->msgcount - ctx->deleted, ctx->deleted); } @@ -1020,8 +1022,10 @@ void mx_update_tables(struct Context *ctx, bool committing) else { if (ctx->magic == MUTT_MH || ctx->magic == MUTT_MAILDIR) + { ctx->size -= (ctx->hdrs[i]->content->length + ctx->hdrs[i]->content->offset - ctx->hdrs[i]->content->hdr_offset); + } /* remove message from the hash tables */ if (ctx->subj_hash && ctx->hdrs[i]->env->real_subj) mutt_hash_delete(ctx->subj_hash, ctx->hdrs[i]->env->real_subj, ctx->hdrs[i]); diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 57bae2c97..55f5a6377 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -369,7 +369,9 @@ int mutt_is_multipart_encrypted(struct Body *b) (mutt_str_strcasecmp(b->subtype, "encrypted") != 0) || !(p = mutt_param_get(&b->parameter, "protocol")) || (mutt_str_strcasecmp(p, "application/pgp-encrypted") != 0)) + { return 0; + } return PGPENCRYPT; } @@ -487,7 +489,9 @@ int mutt_is_application_pgp(struct Body *m) (p = mutt_param_get(&m->parameter, "x-action")) || (p = mutt_param_get(&m->parameter, "action"))) && (mutt_str_strncasecmp("pgp-sign", p, 8) == 0)) + { t |= PGPSIGN; + } else if (p && (mutt_str_strncasecmp("pgp-encrypt", p, 11) == 0)) t |= PGPENCRYPT; else if (p && (mutt_str_strncasecmp("pgp-keys", p, 7) == 0)) @@ -543,8 +547,10 @@ int mutt_is_application_smime(struct Body *m) if (!t) { if (complain) + { mutt_message( _("S/MIME messages with no hints on content are unsupported.")); + } return 0; } @@ -555,9 +561,11 @@ int mutt_is_application_smime(struct Body *m) { len++; if (mutt_str_strcasecmp((t + len), "p7m") == 0) + { /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ return (SMIMESIGN | SMIMEOPAQUE); + } else if (mutt_str_strcasecmp((t + len), "p7s") == 0) return (SMIMESIGN | SMIMEOPAQUE); } @@ -765,9 +773,11 @@ void crypt_extract_keys_from_messages(struct Header *h) if (((WithCrypto & APPLICATION_SMIME) != 0) && (hi->security & APPLICATION_SMIME)) { if (hi->security & ENCRYPT) + { mutt_copy_message_ctx(fpout, Context, hi, MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME, 0); + } else mutt_copy_message_ctx(fpout, Context, hi, 0, 0); fflush(fpout); @@ -806,9 +816,11 @@ void crypt_extract_keys_from_messages(struct Header *h) if (((WithCrypto & APPLICATION_SMIME) != 0) && (h->security & APPLICATION_SMIME)) { if (h->security & ENCRYPT) + { mutt_copy_message_ctx(fpout, Context, h, MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME, 0); + } else mutt_copy_message_ctx(fpout, Context, h, 0, 0); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index b86530835..61131c7b3 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -1253,9 +1253,11 @@ static int show_sig_summary(unsigned long sum, gpgme_ctx_t ctx, gpgme_key_t key, state_puts("\n", s); } else + { state_puts(_("Warning: At least one certification key " "has expired\n"), s); + } } if ((sum & GPGME_SIGSUM_SIG_EXPIRED)) @@ -1275,9 +1277,11 @@ static int show_sig_summary(unsigned long sum, gpgme_ctx_t ctx, gpgme_key_t key, } if ((sum & GPGME_SIGSUM_KEY_MISSING)) + { state_puts(_("Can't verify due to a missing " "key or certificate\n"), s); + } if ((sum & GPGME_SIGSUM_CRL_MISSING)) { @@ -1870,9 +1874,11 @@ restart: *r_is_signed = -1; /* A signature exists. */ if ((s->flags & MUTT_DISPLAY)) + { state_attach_puts(_("[-- Begin signature " "information --]\n"), s); + } for (idx = 0; (res = show_one_sig_status(ctx, idx, s)) != -1; idx++) { if (res == 1) @@ -1884,9 +1890,11 @@ restart: *r_is_signed = anywarn ? 2 : 1; /* Good signature. */ if ((s->flags & MUTT_DISPLAY)) + { state_attach_puts(_("[-- End signature " "information --]\n\n"), s); + } } gpgme_release(ctx); ctx = NULL; @@ -2224,11 +2232,15 @@ static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, int dryrun) strftime(date, sizeof(date), "%Y-%m-%d", localtime(&tt)); if (!more) + { fprintf(*fp, "pub %5.5s %d/%8s %s %s\n", gpgme_pubkey_algo_name(subkey->pubkey_algo), subkey->length, shortid, date, uid->uid); + } else + { fprintf(*fp, "sub %5.5s %d/%8s %s\n", gpgme_pubkey_algo_name(subkey->pubkey_algo), subkey->length, shortid, date); + } subkey = subkey->next; more = 1; } @@ -2724,9 +2736,11 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s) if (!fpout) { if (s->flags & MUTT_DISPLAY) + { state_attach_puts(_("[-- Error: could not create temporary file! " "--]\n"), s); + } return -1; } @@ -2736,11 +2750,13 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s) tattach->goodsig = is_signed > 0; if (s->flags & MUTT_DISPLAY) + { state_attach_puts( is_signed ? _("[-- The following data is PGP/MIME signed and " "encrypted --]\n\n") : _("[-- The following data is PGP/MIME encrypted --]\n\n"), s); + } { FILE *savefp = s->fpin; @@ -2749,11 +2765,10 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s) s->fpin = savefp; } - /* - * if a multipart/signed is the _only_ sub-part of a - * multipart/encrypted, cache signature verification - * status. - */ + /* if a multipart/signed is the _only_ sub-part of a + * multipart/encrypted, cache signature verification + * status. + */ if (mutt_is_multipart_signed(tattach) && !tattach->next) a->goodsig |= tattach->goodsig; @@ -2799,9 +2814,11 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s) if (!fpout) { if (s->flags & MUTT_DISPLAY) + { state_attach_puts(_("[-- Error: could not create temporary file! " "--]\n"), s); + } return -1; } @@ -2811,10 +2828,12 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s) tattach->goodsig = is_signed > 0; if (s->flags & MUTT_DISPLAY) + { state_attach_puts( is_signed ? _("[-- The following data is S/MIME signed --]\n\n") : _("[-- The following data is S/MIME encrypted --]\n\n"), s); + } { FILE *savefp = s->fpin; @@ -3727,8 +3746,10 @@ static void print_key_info(gpgme_key_t key, FILE *fp) { s = key->issuer_serial; if (s) + { fprintf(fp, "%*s0x%s\n", KeyInfoPadding[KIP_SERIAL_NO], _(KeyInfoPrompts[KIP_SERIAL_NO]), s); + } } if (key->issuer_name) @@ -4242,15 +4263,19 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, ts = _("keys matching"); if (p) + { /* L10N: %1$s is one of the previous four entries. %2$s is an address. e.g. "S/MIME keys matching ." */ snprintf(buf, sizeof(buf), _("%s <%s>."), ts, p->mailbox); + } else + { /* L10N: e.g. 'S/MIME keys matching "Michael Elkins".' */ snprintf(buf, sizeof(buf), _("%s \"%s\"."), ts, s); + } menu->title = buf; } @@ -4290,8 +4315,10 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, char buf2[LONG_STRING]; if (key_table[menu->current]->flags & KEYFLAG_CANTUSE) + { warn_s = _("ID is expired/disabled/revoked. Do you really want to " "use the key?"); + } else { warn_s = "??"; diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 43d0fd7f9..885baed6a 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -352,7 +352,9 @@ static struct PgpKeyInfo *parse_pub_line(char *buf, int *is_subkey, struct PgpKe if (!is_uid && (!*is_subkey || !PgpIgnoreSubkeys || !((flags & KEYFLAG_DISABLED) || (flags & KEYFLAG_REVOKED) || (flags & KEYFLAG_EXPIRED)))) + { tmp.flags |= flags; + } break; diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 0d051e13e..dce95ab03 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -405,7 +405,9 @@ int pgp_application_pgp_handler(struct Body *m, struct State *s) (!needpass && ((mutt_str_strcmp("-----END PGP SIGNATURE-----\n", buf) == 0) || (mutt_str_strcmp("-----END PGP PUBLIC KEY BLOCK-----\n", buf) == 0)))) + { break; + } /* remember optional Charset: armor header as defined by RFC4880 */ if (mutt_str_strncmp("Charset: ", buf, 9) == 0) { @@ -859,8 +861,10 @@ static struct Body *pgp_decrypt_part(struct Body *a, struct State *s, mutt_file_fclose(&pgperr); unlink(pgptmpfile); if (s->flags & MUTT_DISPLAY) + { state_attach_puts( _("[-- Error: could not create a PGP subprocess! --]\n\n"), s); + } return NULL; } @@ -1049,8 +1053,10 @@ int pgp_encrypted_handler(struct Body *a, struct State *s) if (tattach) { if (s->flags & MUTT_DISPLAY) + { state_attach_puts( _("[-- The following data is PGP/MIME encrypted --]\n\n"), s); + } fpin = s->fpin; s->fpin = fpout; diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 521fd0c18..01c989407 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -217,11 +217,15 @@ pid_t pgp_invoke_encrypt(FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *fname, const char *uids, int sign) { if (sign) + { return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, 1, fname, NULL, uids, PgpEncryptSignCommand); + } else + { return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, 0, fname, NULL, uids, PgpEncryptOnlyCommand); + } } pid_t pgp_invoke_traditional(FILE **pgpin, FILE **pgpout, FILE **pgperr, @@ -229,12 +233,16 @@ pid_t pgp_invoke_traditional(FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *fname, const char *uids, int flags) { if (flags & ENCRYPT) + { return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, (flags & SIGN) ? 1 : 0, fname, NULL, uids, (flags & SIGN) ? PgpEncryptSignCommand : PgpEncryptOnlyCommand); + } else + { return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, 1, fname, NULL, NULL, PgpClearsignCommand); + } } void pgp_invoke_import(const char *fname) diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index abb00c40d..e577fb33a 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -327,8 +327,10 @@ static int compare_key_address(const void *a, const void *b) if (r != 0) return r > 0; else + { return (mutt_str_strcasecmp(pgp_fpr_or_lkeyid((*s)->parent), pgp_fpr_or_lkeyid((*t)->parent)) > 0); + } } static int pgp_compare_address(const void *a, const void *b) @@ -637,9 +639,12 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, char buf2[LONG_STRING]; if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE) + { str = _("ID is expired/disabled/revoked. Do you really want to use " "the key?"); + } else + { switch (KeyTable[menu->current]->trust & 0x03) { case 0: @@ -654,6 +659,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, "use the key?"); break; } + } snprintf(buf2, sizeof(buf2), "%s", str); diff --git a/ncrypt/smime.c b/ncrypt/smime.c index f056d5f32..d9af6715c 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -1309,8 +1309,10 @@ int smime_verify_sender(struct Header *h) } if (h->security & ENCRYPT) + { mutt_copy_message_ctx(fpout, Context, h, MUTT_CM_DECODE_CRYPT & MUTT_CM_DECODE_SMIME, CH_MIME | CH_WEED | CH_NONEWLINE); + } else mutt_copy_message_ctx(fpout, Context, h, 0, 0); @@ -1847,8 +1849,10 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o mutt_file_fclose(&smimeout); mutt_file_unlink(tmpfname); if (s->flags & MUTT_DISPLAY) + { state_attach_puts( _("[-- Error: unable to create OpenSSL subprocess! --]\n"), s); + } mutt_file_fclose(&smimeerr); return NULL; } @@ -1859,8 +1863,10 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o mutt_file_fclose(&smimeout); mutt_file_unlink(tmpfname); if (s->flags & MUTT_DISPLAY) + { state_attach_puts( _("[-- Error: unable to create OpenSSL subprocess! --]\n"), s); + } mutt_file_fclose(&smimeerr); return NULL; } @@ -1894,9 +1900,11 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o } if (type & ENCRYPT) + { state_attach_puts(_("[-- The following data is S/MIME" " encrypted --]\n"), s); + } else state_attach_puts(_("[-- The following data is S/MIME signed --]\n"), s); } diff --git a/newsrc.c b/newsrc.c index 08e6a39b9..5558ab136 100644 --- a/newsrc.c +++ b/newsrc.c @@ -501,8 +501,10 @@ int nntp_newsrc_update(struct NntpServer *nserv) if (nntp_data->newsrc_ent[j].first == nntp_data->newsrc_ent[j].last) snprintf(buf + off, buflen - off, "%u", nntp_data->newsrc_ent[j].first); else if (nntp_data->newsrc_ent[j].first < nntp_data->newsrc_ent[j].last) + { snprintf(buf + off, buflen - off, "%u-%u", nntp_data->newsrc_ent[j].first, nntp_data->newsrc_ent[j].last); + } off += strlen(buf + off); } buf[off++] = '\n'; @@ -726,7 +728,9 @@ header_cache_t *nntp_hcache_open(struct NntpData *nntp_data) if (!nntp_data->nserv || !nntp_data->nserv->cacheable || !nntp_data->nserv->conn || !nntp_data->group || !(nntp_data->newsrc_ent || nntp_data->subscribed || SaveUnsubscribed)) + { return NULL; + } mutt_account_tourl(&nntp_data->nserv->conn->account, &url); url.path = nntp_data->group; @@ -834,8 +838,10 @@ void nntp_delete_group_cache(struct NntpData *nntp_data) #endif if (!nntp_data->bcache) + { nntp_data->bcache = mutt_bcache_open(&nntp_data->nserv->conn->account, nntp_data->group); + } if (nntp_data->bcache) { mutt_debug(2, "%s/*\n", nntp_data->group); diff --git a/nntp.c b/nntp.c index 2713d6561..e379d8586 100644 --- a/nntp.c +++ b/nntp.c @@ -513,8 +513,10 @@ static int nntp_auth(struct NntpServer *nserv) if (DebugLevel < MUTT_SOCK_LOG_FULL) { if (strchr(buf, ' ')) + { mutt_debug(MUTT_SOCK_LOG_CMD, "%d> AUTHINFO SASL %s%s\n", conn->fd, method, client_len ? " sasl_data" : ""); + } else mutt_debug(MUTT_SOCK_LOG_CMD, "%d> sasl_data\n", conn->fd); } @@ -695,11 +697,13 @@ int nntp_open_connection(struct NntpServer *nserv) if (nserv->use_tls != 1 && (nserv->hasSTARTTLS || SslForceTls)) { if (nserv->use_tls == 0) + { nserv->use_tls = SslForceTls || query_quadoption(SslStarttls, _("Secure connection with TLS?")) == MUTT_YES ? 2 : 1; + } if (nserv->use_tls == 2) { if (mutt_socket_send(conn, "STARTTLS\r\n") < 0 || @@ -1325,13 +1329,17 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, } } else + { for (current = first; current <= last; current++) fc.messages[current - first] = 1; + } /* fetching header from cache or server, or fallback to fetch overview */ if (!ctx->quiet) + { mutt_progress_init(&fc.progress, _("Fetching message headers..."), MUTT_PROGRESS_MSG, ReadInc, last - first + 1); + } for (current = first; current <= last && rc == 0; current++) { if (!ctx->quiet) @@ -1383,10 +1391,12 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, /* fallback to fetch overview */ else if (nntp_data->nserv->hasOVER || nntp_data->nserv->hasXOVER) + { if (NntpListgroup && nntp_data->nserv->hasLISTGROUP) break; else continue; + } /* fetch header from server */ else @@ -1686,8 +1696,10 @@ static int nntp_msg_open(struct Context *ctx, struct Message *msg, int msgno) if (rc > 0) { if (mutt_str_strncmp(NHDR(hdr)->article_num ? "423" : "430", buf, 3) == 0) + { mutt_error(_("Article %d not found on the server."), NHDR(hdr)->article_num ? article : hdr->env->message_id); + } else mutt_error("ARTICLE: %s", buf); } @@ -1813,7 +1825,9 @@ int nntp_post(const char *msg) mutt_socket_send_d(nntp_data->nserv->conn, "\r\n", MUTT_SOCK_LOG_HDR) < 0) || mutt_socket_send_d(nntp_data->nserv->conn, ".\r\n", MUTT_SOCK_LOG_HDR) < 0 || mutt_socket_readln(buf, sizeof(buf), nntp_data->nserv->conn) < 0) + { return nntp_connect_error(nntp_data->nserv); + } if (buf[0] != '2') { mutt_error(_("Can't post article: %s"), buf); @@ -2550,8 +2564,10 @@ int nntp_check_children(struct Context *ctx, const char *msgid) if (mutt_str_strncmp("500", buf, 3) != 0) mutt_error("XPAT: %s", buf); else + { mutt_error(_("Unable to find child articles because server does not " "support XPAT command.")); + } } return -1; } diff --git a/pager.c b/pager.c index 373e47588..b4af3f786 100644 --- a/pager.c +++ b/pager.c @@ -859,9 +859,11 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, if (regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0) { if (q_classify && line_info[n].quote == NULL) + { line_info[n].quote = classify_quote(quote_list, buf + pmatch[0].rm_so, pmatch[0].rm_eo - pmatch[0].rm_so, force_redraw, q_level); + } line_info[n].type = MT_COLOR_QUOTED; } else @@ -875,9 +877,11 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, else { if (q_classify && line_info[n].quote == NULL) + { line_info[n].quote = classify_quote(quote_list, buf + pmatch[0].rm_so, pmatch[0].rm_eo - pmatch[0].rm_so, force_redraw, q_level); + } line_info[n].type = MT_COLOR_QUOTED; } } @@ -928,8 +932,10 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, break; } if (++(line_info[n].chunks) > 1) + { mutt_mem_realloc(&(line_info[n].syntax), (line_info[n].chunks) * sizeof(struct Syntax)); + } } i = line_info[n].chunks - 1; pmatch[0].rm_so += offset; @@ -989,8 +995,10 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, if (!found) { if (++(line_info[n].chunks) > 1) + { mutt_mem_realloc(&(line_info[n].syntax), (line_info[n].chunks) * sizeof(struct Syntax)); + } } i = line_info[n].chunks - 1; pmatch[0].rm_so += offset; @@ -1539,8 +1547,10 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, (offset ? REG_NOTBOL : 0)) == 0) { if (++((*line_info)[n].search_cnt) > 1) + { mutt_mem_realloc(&((*line_info)[n].search), ((*line_info)[n].search_cnt) * sizeof(struct Syntax)); + } else (*line_info)[n].search = mutt_mem_malloc(sizeof(struct Syntax)); pmatch[0].rm_so += offset; @@ -2394,8 +2404,10 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e case OP_HALF_UP: if (rd.topline) + { rd.topline = up_n_lines(rd.pager_window->rows / 2, rd.line_info, rd.topline, rd.hide_quoted); + } else mutt_error(_("Top of message is shown.")); break; @@ -2499,7 +2511,9 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e _("Search for: ") : _("Reverse search for: "), buffer, sizeof(buffer), MUTT_CLEAR) != 0) + { break; + } if (strcmp(buffer, searchbuf) == 0) { @@ -2983,8 +2997,10 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e break; } if (IsMsgAttach(extra)) + { mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDNEWS | SENDREPLY); + } else ci_send_message(SENDNEWS | SENDREPLY, NULL, NULL, extra->ctx, extra->hdr); pager_menu->redraw = REDRAW_FULL; @@ -3013,11 +3029,15 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra)); CHECK_ATTACH; if (IsMsgAttach(extra)) + { mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDREPLY | SENDGROUPREPLY); + } else + { ci_send_message(SENDREPLY | SENDGROUPREPLY, NULL, NULL, extra->ctx, extra->hdr); + } pager_menu->redraw = REDRAW_FULL; break; @@ -3025,11 +3045,15 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra)); CHECK_ATTACH; if (IsMsgAttach(extra)) + { mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDREPLY | SENDLISTREPLY); + } else + { ci_send_message(SENDREPLY | SENDLISTREPLY, NULL, NULL, extra->ctx, extra->hdr); + } pager_menu->redraw = REDRAW_FULL; break; @@ -3160,8 +3184,10 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e r = mutt_thread_set_flag(extra->hdr, MUTT_DELETE, 0, ch == OP_UNDELETE_THREAD ? 0 : 1); if (r != -1) + { r = mutt_thread_set_flag(extra->hdr, MUTT_PURGE, 0, ch == OP_UNDELETE_THREAD ? 0 : 1); + } if (r != -1) { if (Resolve) diff --git a/parse.c b/parse.c index f6710c455..359bf77ac 100644 --- a/parse.c +++ b/parse.c @@ -75,8 +75,10 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen) { /* we did get a full line. remove trailing space */ while (ISSPACE(*buf)) + { *buf-- = 0; /* we cannot come beyond line's beginning because - * it begins with a non-space */ + * it begins with a non-space */ + } /* check to see if the next line is a continuation line */ ch = fgetc(f); @@ -376,10 +378,12 @@ void mutt_parse_content_type(char *s, struct Body *ct) { pc = mutt_param_get(&ct->parameter, "charset"); if (!pc) + { mutt_param_set(&ct->parameter, "charset", (AssumedCharset && *AssumedCharset) ? (const char *) mutt_ch_get_default_charset() : "us-ascii"); + } } } @@ -1301,7 +1305,9 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, if (ReplyRegex && ReplyRegex->regex && (regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0) == 0)) + { e->real_subj = e->subject + pmatch[0].rm_eo; + } else e->real_subj = e->subject; } diff --git a/pattern.c b/pattern.c index 86f3f5f4d..90f584cc0 100644 --- a/pattern.c +++ b/pattern.c @@ -1668,8 +1668,10 @@ int mutt_pattern_exec(struct Pattern *pat, enum PatternExecFlag flags, { cache_entry = pat->alladdr ? &cache->list_all : &cache->list_one; if (!is_pattern_cache_set(*cache_entry)) + { set_pattern_cache_value( cache_entry, mutt_is_list_cc(pat->alladdr, h->env->to, h->env->cc)); + } result = get_pattern_cache_value(*cache_entry); } else @@ -1682,9 +1684,11 @@ int mutt_pattern_exec(struct Pattern *pat, enum PatternExecFlag flags, { cache_entry = pat->alladdr ? &cache->sub_all : &cache->sub_one; if (!is_pattern_cache_set(*cache_entry)) + { set_pattern_cache_value( cache_entry, mutt_is_list_recipient(pat->alladdr, h->env->to, h->env->cc)); + } result = get_pattern_cache_value(*cache_entry); } else @@ -1697,8 +1701,10 @@ int mutt_pattern_exec(struct Pattern *pat, enum PatternExecFlag flags, { cache_entry = pat->alladdr ? &cache->pers_recip_all : &cache->pers_recip_one; if (!is_pattern_cache_set(*cache_entry)) + { set_pattern_cache_value(cache_entry, match_user(pat->alladdr, h->env->to, h->env->cc)); + } result = get_pattern_cache_value(*cache_entry); } else @@ -2046,7 +2052,9 @@ int mutt_search_command(int cur, int op) _("Reverse search for: "), buf, sizeof(buf), MUTT_CLEAR | MUTT_PATTERN) != 0 || !buf[0]) + { return -1; + } if (op == OP_SEARCH || op == OP_SEARCH_NEXT) OptSearchReverse = false; diff --git a/pop.c b/pop.c index a88f1783b..1cc124356 100644 --- a/pop.c +++ b/pop.c @@ -327,8 +327,10 @@ static int pop_fetch_headers(struct Context *ctx) } if (!ctx->quiet) + { mutt_progress_init(&progress, _("Fetching message headers..."), MUTT_PROGRESS_MSG, ReadInc, new_count - old_count); + } if (ret == 0) { diff --git a/postpone.c b/postpone.c index 21891af2f..93f442e18 100644 --- a/postpone.c +++ b/postpone.c @@ -627,7 +627,9 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, (mutt_str_strcasecmp( mutt_param_get(&newhdr->content->parameter, "protocol"), "application/pgp-signature") == 0)) + { newhdr->security |= APPLICATION_PGP; + } else if (WithCrypto & APPLICATION_SMIME) newhdr->security |= APPLICATION_SMIME; @@ -678,7 +680,9 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, { if (mutt_str_strcasecmp("yes", mutt_param_get(&b->parameter, "x-mutt-noconv")) == 0) + { b->noconv = true; + } else { s.flags |= MUTT_CHARCONV; diff --git a/progress.c b/progress.c index a79111305..34a471050 100644 --- a/progress.c +++ b/progress.c @@ -126,8 +126,10 @@ void mutt_progress_init(struct Progress *progress, const char *msg, if (progress->size != 0) { if (progress->flags & MUTT_PROGRESS_SIZE) + { mutt_str_pretty_size(progress->sizestr, sizeof(progress->sizestr), progress->size); + } else snprintf(progress->sizestr, sizeof(progress->sizestr), "%zu", progress->size); } @@ -143,8 +145,10 @@ void mutt_progress_init(struct Progress *progress, const char *msg, mutt_debug(1, "gettimeofday failed: %d\n", errno); /* if timestamp is 0 no time-based suppression is done */ if (TimeInc != 0) + { progress->timestamp = ((unsigned int) tv.tv_sec * 1000) + (unsigned int) (tv.tv_usec / 1000); + } mutt_progress_update(progress, 0, 0); } @@ -173,7 +177,9 @@ void mutt_progress_update(struct Progress *progress, long pos, int percent) /* refresh if size > inc */ if ((progress->flags & MUTT_PROGRESS_SIZE) && (pos >= (progress->pos + (progress->inc << 10)))) + { update = true; + } else if (pos >= (progress->pos + progress->inc)) update = true; diff --git a/recvattach.c b/recvattach.c index 018b71afa..2e065e5fb 100644 --- a/recvattach.c +++ b/recvattach.c @@ -440,7 +440,9 @@ static void prepend_curdir(char *dst, size_t dstlen) if (!dst || !*dst || *dst == '/' || dstlen < 3 || /* XXX bad modularization, these are special to mutt_expand_path() */ !strchr("~=+@<>!-^", *dst)) + { return; + } dstlen -= 3; l = strlen(dst) + 2; @@ -462,8 +464,10 @@ static int query_save_attachment(FILE *fp, struct Body *body, if (body->filename) { if (directory && *directory) + { mutt_file_concat_path(buf, *directory, mutt_file_basename(body->filename), sizeof(buf)); + } else mutt_str_strfcpy(buf, body->filename, sizeof(buf)); } @@ -725,7 +729,9 @@ void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, if (mutt_get_field((filter ? _("Filter through: ") : _("Pipe to: ")), buf, sizeof(buf), MUTT_CMD) != 0 || !buf[0]) + { return; + } mutt_expand_path(buf, sizeof(buf)); @@ -1319,8 +1325,10 @@ void mutt_view_attachments(struct Header *hdr) menu->redraw = REDRAW_CURRENT; } else + { mutt_message( _("Only deletion of multipart attachments is supported.")); + } } else { @@ -1334,8 +1342,10 @@ void mutt_view_attachments(struct Header *hdr) menu->redraw = REDRAW_INDEX; } else + { mutt_message( _("Only deletion of multipart attachments is supported.")); + } } } } diff --git a/recvcmd.c b/recvcmd.c index 45cfc6d7a..8918023b9 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -314,7 +314,9 @@ static struct AttachPtr *find_parent(struct AttachCtx *actx, struct Body *cur, s if (mutt_is_message_type(actx->idx[i]->content->type, actx->idx[i]->content->subtype) && is_parent(i, actx, cur)) + { parent = actx->idx[i]; + } if (actx->idx[i]->content == cur) break; } @@ -338,8 +340,10 @@ static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp, if (prefix) mutt_str_strfcpy(prefix2, prefix, sizeof(prefix2)); else if (!TextFlowed) + { mutt_make_string_flags(prefix2, sizeof(prefix2), NONULL(IndentString), Context, hdr, 0); + } else mutt_str_strfcpy(prefix2, ">", sizeof(prefix2)); @@ -424,8 +428,10 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx if (ForwardQuote) { if (!TextFlowed) + { mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString), Context, parent_hdr, 0); + } else mutt_str_strfcpy(prefix, ">", sizeof(prefix)); } @@ -882,8 +888,10 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx, st.fpout = tmpfp; if (!TextFlowed) + { mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString), Context, parent_hdr, 0); + } else mutt_str_strfcpy(prefix, ">", sizeof(prefix)); diff --git a/rfc1524.c b/rfc1524.c index c9871e697..92b8b8e0f 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -239,7 +239,9 @@ static int rfc1524_mailcap_parse(struct Body *a, char *filename, char *type, ((mutt_str_strncasecmp(buf, type, btlen) != 0) || (buf[btlen] != 0 && /* implicit wild */ (mutt_str_strcmp(buf + btlen, "/*") != 0)))) /* wildsubtype */ + { continue; + } /* next field is the viewcommand */ char *field = ch; diff --git a/score.c b/score.c index 44d81ff23..3dab48167 100644 --- a/score.c +++ b/score.c @@ -128,11 +128,13 @@ int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, ptr->str = pattern; } else + { /* 'buf' arg was cleared and 'pattern' holds the only reference; * as here 'ptr' != NULL -> update the value only in which case * ptr->str already has the string, so pattern should be freed. */ FREE(&pattern); + } pc = buf->data; if (*pc == '=') { diff --git a/send.c b/send.c index 965b35cb4..b1a759e9f 100644 --- a/send.c +++ b/send.c @@ -920,7 +920,9 @@ static int generate_body(FILE *tempfp, struct Header *msg, int flags, if (((WithCrypto & APPLICATION_PGP) != 0) && (b = crypt_pgp_make_key_attachment(NULL)) == NULL) + { return -1; + } b->next = msg->content; msg->content = b; @@ -1121,8 +1123,10 @@ static int send_message(struct Header *msg) if (!OptNewsSend) #endif if (SmtpUrl) + { return mutt_smtp_send(msg->env->from, msg->env->to, msg->env->cc, msg->env->bcc, tempfile, (msg->content->encoding == ENC8BIT)); + } #endif /* USE_SMTP */ i = mutt_invoke_sendmail(msg->env->from, msg->env->to, msg->env->cc, msg->env->bcc, @@ -1242,7 +1246,9 @@ static bool search_attach_keyword(char *filename) /* Search for the regex in AbortNoattachRegex within a file */ if (!AbortNoattachRegex || !AbortNoattachRegex->regex || !QuoteRegex || !QuoteRegex->regex) + { return false; + } FILE *attf = mutt_file_fopen(filename, "r"); if (!attf) @@ -1442,8 +1448,10 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, */ if (msg->env->from) + { mutt_debug(5, "msg->env->from before set_reverse_name: %s\n", msg->env->from->mailbox); + } msg->env->from = set_reverse_name(cur->env); } if (cur && ReplyWithXorig && !(flags & (SENDPOSTPONED | SENDRESEND | SENDFORWARD))) diff --git a/sendlib.c b/sendlib.c index 6f3ebdd7f..17bc47b9c 100644 --- a/sendlib.c +++ b/sendlib.c @@ -333,7 +333,9 @@ int mutt_write_mime_header(struct Body *a, FILE *f) if ((mutt_str_strcasecmp(np->attribute, "boundary") == 0) && (strcmp(buffer, tmp) == 0)) + { snprintf(buffer, sizeof(buffer), "\"%s\"", tmp); + } FREE(&tmp); @@ -961,9 +963,11 @@ struct Content *mutt_get_content_info(const char *fname, struct Body *b) mutt_file_fclose(&fp); if (b != NULL && b->type == TYPETEXT && (!b->noconv && !b->force_charset)) + { mutt_param_set(&b->parameter, "charset", (!info->hibin ? "us-ascii" : Charset && !mutt_ch_is_us_ascii(Charset) ? Charset : "unknown-8bit")); + } return info; } diff --git a/sidebar.c b/sidebar.c index 0af05c68b..9ff44f951 100644 --- a/sidebar.c +++ b/sidebar.c @@ -237,11 +237,15 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int } if (optional) + { mutt_expando_format(buf, buflen, col, SidebarWidth, if_str, sidebar_format_str, (unsigned long) sbe, flags); + } else if (flags & MUTT_FORMAT_OPTIONAL) + { mutt_expando_format(buf, buflen, col, SidebarWidth, else_str, sidebar_format_str, (unsigned long) sbe, flags); + } /* We return the format string, unchanged */ return src; @@ -883,7 +887,9 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width) if ((mutt_str_strlen(b->path) > maildirlen) && (mutt_str_strncmp(Folder, b->path, maildirlen) == 0) && SidebarDelimChars && strchr(SidebarDelimChars, b->path[maildirlen])) + { maildir_is_prefix = true; + } /* calculate depth of current folder and generate its display name with indented spaces */ int sidebar_folder_depth = 0; diff --git a/smtp.c b/smtp.c index 459bb40b9..b4e6ca084 100644 --- a/smtp.c +++ b/smtp.c @@ -588,7 +588,9 @@ static int smtp_open(struct Connection *conn) else if (mutt_bit_isset(Capabilities, STARTTLS) && (rc = query_quadoption(SslStarttls, _("Secure connection with TLS?"))) == MUTT_ABORT) + { return rc; + } if (rc == MUTT_YES) { diff --git a/state.c b/state.c index 3e837baf1..c942ad49e 100644 --- a/state.c +++ b/state.c @@ -108,8 +108,10 @@ int state_printf(struct State *s, const char *fmt, ...) void state_prefix_put(const char *d, size_t dlen, struct State *s) { if (s->prefix) + { while (dlen--) state_prefix_putc(*d++, s); + } else fwrite(d, dlen, 1, s->fpout); } diff --git a/status.c b/status.c index 07d029c27..515cb0d81 100644 --- a/status.c +++ b/status.c @@ -256,11 +256,13 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c if (!menu) break; if (menu->top + menu->pagelen >= menu->max) + { cp = menu->top ? /* L10N: Status bar message: the end of the list emails is visible in the index */ _("end") : /* L10N: Status bar message: all the emails are visible in the index */ _("all"); + } else { count = (100 * (menu->top + menu->pagelen)) / menu->max; diff --git a/thread.c b/thread.c index ecfbd68f3..83053b323 100644 --- a/thread.c +++ b/thread.c @@ -286,8 +286,10 @@ void mutt_draw_tree(struct Context *ctx) else myarrow[0] = vtee; if (width == 2) + { myarrow[1] = pseudo ? MUTT_TREE_STAR : (tree->duplicate_thread ? MUTT_TREE_EQUALS : MUTT_TREE_HLINE); + } if (tree->visible) { myarrow[width] = MUTT_TREE_RARROW; @@ -612,8 +614,10 @@ static int compare_threads(const void *a, const void *b) static sort_t *sort_func = NULL; if (a && b) + { return ((*sort_func)(&(*((struct MuttThread **) a))->sort_key, &(*((struct MuttThread **) b))->sort_key)); + } /* a hack to let us reset sort_func even though we can't * have extra arguments because of qsort */ @@ -725,7 +729,9 @@ struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init) if (!thread->sort_key || ((((Sort & SORT_REVERSE) ? 1 : -1) * compare_threads((void *) &thread, (void *) &sort_key)) > 0)) + { thread->sort_key = sort_key->sort_key; + } } else if (!thread->sort_key) thread->sort_key = sort_key->sort_key; @@ -774,11 +780,15 @@ static void check_subjects(struct Context *ctx, int init) if (!tmp) cur->subject_changed = true; else if (cur->env->real_subj && tmp->message->env->real_subj) + { cur->subject_changed = (mutt_str_strcmp(cur->env->real_subj, tmp->message->env->real_subj) != 0) ? true : false; + } else + { cur->subject_changed = (cur->env->real_subj || tmp->message->env->real_subj) ? true : false; + } } } @@ -1381,8 +1391,10 @@ int mutt_messages_in_thread(struct Context *ctx, struct Header *hdr, int flag) if (Sort & SORT_REVERSE) rc = threads[0]->message->msgno - (threads[1] ? threads[1]->message->msgno : -1); else + { rc = (threads[1] ? threads[1]->message->msgno : ctx->msgcount) - threads[0]->message->msgno; + } if (flag) rc += 1; -- 2.40.0