diff --git a/attach.c b/attach.c index e67b96d3c26..b0bad4c90e8 100644 --- a/attach.c +++ b/attach.c @@ -323,18 +323,18 @@ void mutt_check_lookup_list(struct Body *b, char *type, size_t len) if (n != TYPEOTHER) { snprintf(type, len, "%s/%s", - n == TYPEAUDIO ? - "audio" : - n == TYPEAPPLICATION ? - "application" : - n == TYPEIMAGE ? - "image" : - n == TYPEMESSAGE ? - "message" : - n == TYPEMODEL ? "model" : - n == TYPEMULTIPART ? - "multipart" : - n == TYPETEXT ? "text" : n == TYPEVIDEO ? "video" : "other", + n == TYPEAUDIO ? "audio" : + n == TYPEAPPLICATION ? + "application" : + n == TYPEIMAGE ? + "image" : + n == TYPEMESSAGE ? + "message" : + n == TYPEMODEL ? + "model" : + n == TYPEMULTIPART ? + "multipart" : + n == TYPETEXT ? "text" : n == TYPEVIDEO ? "video" : "other", tmp.subtype); mutt_debug(1, "\"%s\" -> %s\n", b->filename, type); } diff --git a/body.c b/body.c index b84799ac792..341f4d98017 100644 --- a/body.c +++ b/body.c @@ -104,10 +104,10 @@ int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src) struct Parameter *np, *new; TAILQ_FOREACH(np, &src->parameter, entries) { - new = mutt_param_new(); - new->attribute = mutt_str_strdup(np->attribute); - new->value = mutt_str_strdup(np->value); - TAILQ_INSERT_HEAD(&b->parameter, new, entries); + new = mutt_param_new(); + new->attribute = mutt_str_strdup(np->attribute); + new->value = mutt_str_strdup(np->value); + TAILQ_INSERT_HEAD(&b->parameter, new, entries); } mutt_stamp_attachment(b); diff --git a/browser.c b/browser.c index a05a81adbfe..e5d00e19b57 100644 --- a/browser.c +++ b/browser.c @@ -337,8 +337,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c else { tnow = time(NULL); - t_fmt = - tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y"; + t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y"; } if (!do_locales) @@ -730,7 +729,8 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, continue; if (prefix && *prefix && (strncmp(prefix, nntp_data->group, strlen(prefix)) != 0)) continue; - if (Mask && Mask->regex && !((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not)) + 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); } @@ -788,7 +788,8 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, { continue; } - if (Mask && Mask->regex && !((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not)) + 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)); @@ -1411,7 +1412,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi #ifdef USE_IMAP || state.entry[menu->current].inferiors #endif - ) + ) { /* make sure this isn't a MH or maildir mailbox */ if (buffy) @@ -1433,7 +1434,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi #ifdef USE_IMAP || state.entry[menu->current].inferiors #endif - ) + ) { /* save the old directory */ mutt_str_strfcpy(OldLastDir, LastDir, sizeof(OldLastDir)); @@ -1548,7 +1549,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi #endif else mutt_file_concat_path(f, LastDir, state.entry[menu->current].name, flen); - /* fallthrough */ + /* fallthrough */ case OP_EXIT: diff --git a/buffy.c b/buffy.c index 79dfa0fd47b..7b6bca8c1e2 100644 --- a/buffy.c +++ b/buffy.c @@ -91,8 +91,7 @@ static int fseek_last_message(FILE *f) /* 'i' is Index into `buffer' for scanning. */ for (int i = bytes_read; i >= 0; i--) { - if (mutt_str_strncmp(buffer + i, "\n\nFrom ", - mutt_str_strlen("\n\nFrom ")) == 0) + if (mutt_str_strncmp(buffer + i, "\n\nFrom ", mutt_str_strlen("\n\nFrom ")) == 0) { /* found it - go to the beginning of the From */ fseeko(f, pos + i + 2, SEEK_SET); return 0; diff --git a/color.c b/color.c index 74224dcdefa..64f7cecdaf6 100644 --- a/color.c +++ b/color.c @@ -537,7 +537,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat /* We don't even have colors compiled in */ parse_uncolor #endif - ) + ) { /* just eat the command, but don't do anything real about it */ do @@ -871,7 +871,8 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, #ifdef HAVE_COLOR #ifdef HAVE_USE_DEFAULT_COLORS - if (!OPT_NO_CURSES && has_colors() + if (!OPT_NO_CURSES && + has_colors() /* delay use_default_colors() until needed, since it initializes things */ && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT || object == MT_COLOR_TREE) && use_default_colors() != OK) diff --git a/commands.c b/commands.c index 03a1a417936..129501183e5 100644 --- a/commands.c +++ b/commands.c @@ -519,8 +519,7 @@ void mutt_print_message(struct Header *h) return; } - if (query_quadoption(Print, - h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES) + if (query_quadoption(Print, h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES) { return; } @@ -528,8 +527,7 @@ void mutt_print_message(struct Header *h) if (pipe_message(h, PrintCommand, PrintDecode, 1, PrintSplit, "\f") == 0) mutt_message(h ? _("Message printed") : _("Messages printed")); else - mutt_message(h ? _("Message could not be printed") : - _("Messages could not be printed")); + mutt_message(h ? _("Message could not be printed") : _("Messages could not be printed")); } int mutt_select_sort(int reverse) @@ -765,12 +763,10 @@ int mutt_save_message(struct Header *h, int delete, int decode, int decrypt) struct stat st; snprintf(prompt, sizeof(prompt), - decode ? (delete ? _("Decode-save%s to mailbox") : - _("Decode-copy%s to mailbox")) : - (decrypt ? (delete ? _("Decrypt-save%s to mailbox") : - _("Decrypt-copy%s to mailbox")) : - (delete ? _("Save%s to mailbox") : - _("Copy%s to mailbox"))), + decode ? + (delete ? _("Decode-save%s to mailbox") : _("Decode-copy%s to mailbox")) : + (decrypt ? (delete ? _("Decrypt-save%s to mailbox") : _("Decrypt-copy%s to mailbox")) : + (delete ? _("Save%s to mailbox") : _("Copy%s to mailbox"))), h ? "" : _(" tagged")); if (h) @@ -993,7 +989,8 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) snprintf(tmp, sizeof(tmp), "%s/%s", TYPE(b), NONULL(b->subtype)); type_changed = mutt_str_strcasecmp(tmp, obuf); - charset_changed = mutt_str_strcasecmp(charset, mutt_param_get(&b->parameter, "charset")); + charset_changed = + mutt_str_strcasecmp(charset, mutt_param_get(&b->parameter, "charset")); /* if in send mode, check for conversion - current setting is default. */ diff --git a/compose.c b/compose.c index 7b7b3d752a2..84abb6319e1 100644 --- a/compose.c +++ b/compose.c @@ -311,8 +311,7 @@ static void redraw_crypt_lines(struct Header *msg) (msg->security & ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith) { SETCOLOR(MT_COLOR_COMPOSE_HEADER); - mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", - _("Encrypt with: ")); + mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: ")); NORMAL_COLOR; printw("%s", NONULL(SmimeEncryptWith)); } @@ -1543,7 +1542,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */ } else if (i == MUTT_ABORT) break; /* abort */ - /* fallthrough */ + /* fallthrough */ case OP_COMPOSE_POSTPONE_MESSAGE: diff --git a/conn/sasl.c b/conn/sasl.c index 51983b4db4e..14db77f0f79 100644 --- a/conn/sasl.c +++ b/conn/sasl.c @@ -115,8 +115,9 @@ static int getnameinfo_err(int ret) err = SASL_FAIL; /* no real equivalent */ break; case EAI_SYSTEM: - mutt_debug(1, "A system error occurred. The error code can be found in " - "errno(%d,%s)).\n", + mutt_debug(1, + "A system error occurred. The error code can be found in " + "errno(%d,%s)).\n", errno, strerror(errno)); err = SASL_FAIL; /* no real equivalent */ break; diff --git a/conn/ssl.c b/conn/ssl.c index 9d720a47110..417e9639f9f 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -824,7 +824,7 @@ static int check_host(X509 *x509cert, const char *hostname, char *err, size_t er /* did we find a name matching hostname? */ bool match_found; -/* Check if 'hostname' matches the one of the subjectAltName extensions of + /* Check if 'hostname' matches the one of the subjectAltName extensions of * type DNS or the Common Name (CN). */ #ifdef HAVE_LIBIDN @@ -992,8 +992,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int x509_get_part(x509_issuer, part[u])); row++; - snprintf(menu->dialog[row++], SHORT_STRING, "%s", - _("This certificate is valid")); + snprintf(menu->dialog[row++], SHORT_STRING, "%s", _("This certificate is valid")); snprintf(menu->dialog[row++], SHORT_STRING, _(" from %s"), asn1time_to_string(X509_get_notBefore(cert))); snprintf(menu->dialog[row++], SHORT_STRING, _(" to %s"), diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index 857eb1d68c2..553e7e9e7d8 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -314,8 +314,7 @@ static int tls_check_stored_hostname(const gnutls_datum_t *cert, const char *hos fp = fopen(CertificateFile, "r"); if (fp) { - if (REGCOMP(&preg, - "^#H ([a-zA-Z0-9_\\.-]+) ([0-9A-F]{4}( [0-9A-F]{4}){7})[ \t]*$", + if (REGCOMP(&preg, "^#H ([a-zA-Z0-9_\\.-]+) ([0-9A-F]{4}( [0-9A-F]{4}){7})[ \t]*$", REG_ICASE) != 0) { mutt_file_fclose(&fp); diff --git a/copy.c b/copy.c index 0b6d078c92c..6f7b1a756ba 100644 --- a/copy.c +++ b/copy.c @@ -392,8 +392,7 @@ int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const cha fputs("MIME-Version: 1.0\n", out); fputs("Content-Transfer-Encoding: 8bit\n", out); fputs("Content-Type: text/plain; charset=", out); - mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf), - Charset ? Charset : "us-ascii"); + mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf), Charset ? Charset : "us-ascii"); mutt_addr_cat(buffer, sizeof(buffer), chsbuf, MimeSpecials); fputs(buffer, out); fputc('\n', out); diff --git a/curs_lib.c b/curs_lib.c index 204d51455d1..581771cdfc1 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -455,7 +455,8 @@ void mutt_progress_init(struct Progress *progress, const char *msg, if (progress->size) { if (progress->flags & MUTT_PROGRESS_SIZE) - mutt_str_pretty_size(progress->sizestr, sizeof(progress->sizestr), progress->size); + mutt_str_pretty_size(progress->sizestr, sizeof(progress->sizestr), + progress->size); else snprintf(progress->sizestr, sizeof(progress->sizestr), "%zu", progress->size); } @@ -585,11 +586,12 @@ void mutt_progress_update(struct Progress *progress, long pos, int percent) if (progress->size > 0) { - message_bar((percent > 0) ? percent : (int) (100.0 * (double) progress->pos / - progress->size), - "%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr, - (percent > 0) ? percent : (int) (100.0 * (double) progress->pos / - progress->size)); + message_bar( + (percent > 0) ? percent : + (int) (100.0 * (double) progress->pos / progress->size), + "%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr, + (percent > 0) ? percent : + (int) (100.0 * (double) progress->pos / progress->size)); } else { diff --git a/curs_main.c b/curs_main.c index 761535f9af5..c5d5f0dac7c 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1181,9 +1181,9 @@ int mutt_index_menu(void) switch (op) { - /* ---------------------------------------------------------------------- - * movement commands - */ + /* ---------------------------------------------------------------------- + * movement commands + */ case OP_BOTTOM_PAGE: menu_bottom_page(menu); @@ -1232,7 +1232,7 @@ int mutt_index_menu(void) case OP_GET_PARENT: CHECK_MSGCOUNT; CHECK_VISIBLE; - /* fallthrough */ + /* fallthrough */ case OP_GET_MESSAGE: CHECK_IN_MAILBOX; @@ -1463,7 +1463,7 @@ int mutt_index_menu(void) break; - /* -------------------------------------------------------------------- + /* -------------------------------------------------------------------- * `index' specific commands */ @@ -1652,10 +1652,11 @@ int mutt_index_menu(void) { mutt_set_flag(Context, CURHDR, MUTT_TAG, !CURHDR->tagged); - Context->last_tag = - CURHDR->tagged ? CURHDR : ((Context->last_tag == CURHDR && !CURHDR->tagged) ? - NULL : - Context->last_tag); + Context->last_tag = CURHDR->tagged ? + CURHDR : + ((Context->last_tag == CURHDR && !CURHDR->tagged) ? + NULL : + Context->last_tag); menu->redraw |= REDRAW_STATUS; if (Resolve && menu->current < Context->vcount - 1) @@ -1707,7 +1708,7 @@ int mutt_index_menu(void) } break; -/* -------------------------------------------------------------------- + /* -------------------------------------------------------------------- * The following operations can be performed inside of the pager. */ @@ -2772,9 +2773,9 @@ int mutt_index_menu(void) collapse_all(menu, 1); break; - /* -------------------------------------------------------------------- - * These functions are invoked directly from the internal-pager - */ + /* -------------------------------------------------------------------- + * These functions are invoked directly from the internal-pager + */ case OP_BOUNCE_MESSAGE: @@ -3174,7 +3175,7 @@ int mutt_index_menu(void) case OP_FORWARD_TO_GROUP: CHECK_MSGCOUNT; CHECK_VISIBLE; - /* fallthrough */ + /* fallthrough */ case OP_POST: CHECK_ATTACH; diff --git a/enter.c b/enter.c index dfc6c370d20..269a3ffddf5 100644 --- a/enter.c +++ b/enter.c @@ -469,7 +469,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul { goto self_insert; } - /* fallthrough */ + /* fallthrough */ case OP_EDITOR_COMPLETE: case OP_EDITOR_COMPLETE_QUERY: diff --git a/flags.c b/flags.c index 97b6cb0230e..f0333a14a89 100644 --- a/flags.c +++ b/flags.c @@ -395,8 +395,8 @@ int mutt_change_flag(struct Header *h, int bf) int i, flag; struct Event event; - mutt_window_mvprintw(MuttMessageWindow, 0, 0, "%s? (D/N/O/r/*/!): ", - bf ? _("Set flag") : _("Clear flag")); + mutt_window_mvprintw(MuttMessageWindow, 0, 0, + "%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag")); mutt_window_clrtoeol(MuttMessageWindow); event = mutt_getch(); diff --git a/from.c b/from.c index 87fb40140ec..5582fe5ef45 100644 --- a/from.c +++ b/from.c @@ -77,8 +77,9 @@ int is_from(const char *s, char *path, size_t pathlen, time_t *tp) p = strchr(p + 4, ' '); if (!p) { - mutt_debug(1, "error parsing what appears to be a pipermail-style " - "obscured return_path: %s\n", + mutt_debug(1, + "error parsing what appears to be a pipermail-style " + "obscured return_path: %s\n", s); return 0; } diff --git a/functions.h b/functions.h index 0af28f0a46e..b96e24e0aa5 100644 --- a/functions.h +++ b/functions.h @@ -536,7 +536,7 @@ const struct Binding OpEditor[] = { /* map: editor */ { "buffy-cycle", OP_EDITOR_BUFFY_CYCLE, " " }, { "history-up", OP_EDITOR_HISTORY_UP, NULL }, { "history-down", OP_EDITOR_HISTORY_DOWN, NULL }, - { "history-search", OP_EDITOR_HISTORY_SEARCH, "\022" }, + { "history-search", OP_EDITOR_HISTORY_SEARCH, "\022" }, { "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS, NULL }, { NULL, 0, NULL }, }; diff --git a/handler.c b/handler.c index ff3702aaf75..f56568e906b 100644 --- a/handler.c +++ b/handler.c @@ -398,9 +398,9 @@ static void decode_uuencoded(struct State *s, long len, int istext, iconv_t cd) state_reset_prefix(s); } -/* ---------------------------------------------------------------------------- - * A (not so) minimal implementation of RFC1563. - */ + /* ---------------------------------------------------------------------------- + * A (not so) minimal implementation of RFC1563. + */ #define INDENT_SIZE 4 @@ -1551,8 +1551,7 @@ static int external_body_handler(struct Body *b, struct State *s) state_printf(s, _("[-- This %s/%s attachment is not included, --]\n"), TYPE(b->parts), b->parts->subtype); state_mark_attach(s); - state_printf( - s, _("[-- and the indicated access-type %s is unsupported --]\n"), access_type); + state_printf(s, _("[-- and the indicated access-type %s is unsupported --]\n"), access_type); mutt_copy_hdr(s->fpin, s->fpout, ftello(s->fpin), b->parts->offset, (Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY, NULL); } @@ -1829,7 +1828,8 @@ int mutt_body_handler(struct Body *b, struct State *s) if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)) handler = crypt_pgp_application_pgp_handler; else if (ReflowText && - (mutt_str_strcasecmp("flowed", mutt_param_get(&b->parameter, "format")) == 0)) + (mutt_str_strcasecmp("flowed", + mutt_param_get(&b->parameter, "format")) == 0)) { handler = rfc3676_handler; } @@ -1884,8 +1884,7 @@ int mutt_body_handler(struct Body *b, struct State *s) if (b->encoding != ENC7BIT && b->encoding != ENC8BIT && b->encoding != ENCBINARY) { - mutt_debug(1, - "Bad encoding type %d for multipart entity, assuming 7 bit\n", b->encoding); + mutt_debug(1, "Bad encoding type %d for multipart entity, assuming 7 bit\n", b->encoding); b->encoding = ENC7BIT; } } diff --git a/hcache/kc.c b/hcache/kc.c index e7bb924e166..57fb71cefe3 100644 --- a/hcache/kc.c +++ b/hcache/kc.c @@ -42,9 +42,8 @@ static void *hcache_kyotocabinet_open(const char *path) char kcdbpath[_POSIX_PATH_MAX]; int printfresult; - printfresult = - snprintf(kcdbpath, sizeof(kcdbpath), "%s#type=kct#opts=%s#rcomp=lex", - path, HeaderCacheCompress ? "lc" : "l"); + printfresult = snprintf(kcdbpath, sizeof(kcdbpath), "%s#type=kct#opts=%s#rcomp=lex", + path, HeaderCacheCompress ? "lc" : "l"); if ((printfresult < 0) || (printfresult >= sizeof(kcdbpath))) { return NULL; diff --git a/hdrline.c b/hdrline.c index d88266549e9..e63b0f85748 100644 --- a/hdrline.c +++ b/hdrline.c @@ -226,7 +226,10 @@ static const char *make_from_prefix(enum FieldType disp) /* need 2 bytes at the end, one for the space, another for NUL */ static char padded[8]; static const char *long_prefixes[DISP_NUM] = { - [DISP_TO] = "To ", [DISP_CC] = "Cc ", [DISP_BCC] = "Bcc ", [DISP_FROM] = "", + [DISP_TO] = "To ", + [DISP_CC] = "Cc ", + [DISP_BCC] = "Bcc ", + [DISP_FROM] = "", }; if (!FromChars || !FromChars->chars || (FromChars->len == 0)) @@ -519,7 +522,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co break; } } - /* fallthrough */ + /* fallthrough */ case 'a': colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR); @@ -551,8 +554,8 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co /* break if 'K' returns nothing */ break; } - /* if 'B' returns nothing */ - /* fallthrough */ + /* if 'B' returns nothing */ + /* fallthrough */ case 'b': if (ctx) diff --git a/help.c b/help.c index 3eec6b609e0..d70cd1bf581 100644 --- a/help.c +++ b/help.c @@ -321,8 +321,7 @@ static void dump_menu(FILE *f, int menu) { b = help_lookup_function(map->op, menu); format_line(f, 0, buf, b ? b->name : "UNKNOWN", - b ? _(HelpStrings[b->op]) : - _("ERROR: please report this bug")); + b ? _(HelpStrings[b->op]) : _("ERROR: please report this bug")); } } } diff --git a/hook.c b/hook.c index 687f93e8de2..0ed9895d828 100644 --- a/hook.c +++ b/hook.c @@ -332,8 +332,8 @@ int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, } if (current_hook_type == type) { - snprintf(err->data, err->dsize, - _("unhook: Can't delete a %s from within a %s."), buf->data, buf->data); + snprintf(err->data, err->dsize, _("unhook: Can't delete a %s from within a %s."), + buf->data, buf->data); return -1; } delete_hooks(type); diff --git a/imap/command.c b/imap/command.c index cddeadd2418..bbde4d33c82 100644 --- a/imap/command.c +++ b/imap/command.c @@ -707,11 +707,9 @@ static void cmd_parse_status(struct ImapData *idata, char *s) if (*s && *s != ')') s = imap_next_word(s); } - mutt_debug( - 3, - "%s (UIDVALIDITY: %u, UIDNEXT: %u) %d messages, %d recent, %d unseen\n", - status->name, status->uidvalidity, status->uidnext, status->messages, - status->recent, status->unseen); + mutt_debug(3, "%s (UIDVALIDITY: %u, UIDNEXT: %u) %d messages, %d recent, %d unseen\n", + status->name, status->uidvalidity, status->uidnext, + status->messages, status->recent, status->unseen); /* caller is prepared to handle the result herself */ if (idata->cmddata && idata->cmdtype == IMAP_CT_STATUS) diff --git a/imap/imap.c b/imap/imap.c index 48ae5643fd2..405cebe48f4 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2094,8 +2094,7 @@ static int imap_open_mailbox(struct Context *ctx) } FREE(&pmx.mbox); - snprintf(bufout, sizeof(bufout), "%s %s", - ctx->readonly ? "EXAMINE" : "SELECT", buf); + snprintf(bufout, sizeof(bufout), "%s %s", ctx->readonly ? "EXAMINE" : "SELECT", buf); idata->state = IMAP_SELECTED; diff --git a/imap/message.c b/imap/message.c index 34e4317653c..ff7a76a272b 100644 --- a/imap/message.c +++ b/imap/message.c @@ -734,18 +734,17 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i if (!h.data->uid) { - mutt_debug(2, "skipping hcache FETCH response for message number %d " - "missing a UID\n", + mutt_debug(2, + "skipping hcache FETCH response for message number %d " + "missing a UID\n", h.data->msn); continue; } if (h.data->msn < 1 || h.data->msn > msn_end) { - mutt_debug( - 1, - "skipping hcache FETCH response for unknown message number %d\n", - h.data->msn); + mutt_debug(1, "skipping hcache FETCH response for unknown message number %d\n", + h.data->msn); continue; } @@ -863,8 +862,7 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i if (h.data->msn < 1 || h.data->msn > fetch_msn_end) { - mutt_debug(1, - "skipping FETCH response for unknown message number %d\n", + mutt_debug(1, "skipping FETCH response for unknown message number %d\n", h.data->msn); continue; } diff --git a/init.c b/init.c index bb32fb89c09..7be8ebe9569 100644 --- a/init.c +++ b/init.c @@ -844,8 +844,7 @@ static int parse_ifdef(struct Buffer *tmp, struct Buffer *s, unsigned long data, if (!MoreArgs(s)) { - snprintf(err->data, err->dsize, _("%s: too few arguments"), - (data ? "ifndef" : "ifdef")); + snprintf(err->data, err->dsize, _("%s: too few arguments"), (data ? "ifndef" : "ifdef")); return -1; } mutt_extract_token(tmp, s, MUTT_TOKEN_SPACE); @@ -1307,8 +1306,8 @@ static int parse_group(struct Buffer *buf, struct Buffer *s, unsigned long data, goto bail; if (mutt_addrlist_to_intl(addr, &estr)) { - snprintf(err->data, err->dsize, - _("%sgroup: warning: bad IDN '%s'.\n"), data == 1 ? "un" : "", estr); + snprintf(err->data, err->dsize, _("%sgroup: warning: bad IDN '%s'.\n"), + data == 1 ? "un" : "", estr); mutt_addr_free(&addr); FREE(&estr); goto bail; @@ -2336,8 +2335,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, { if (query || unset || inv) { - snprintf(err->data, err->dsize, "%s", - _("prefix is illegal with reset")); + snprintf(err->data, err->dsize, "%s", _("prefix is illegal with reset")); return -1; } @@ -2351,8 +2349,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, { if (CurrentMenu == MENU_PAGER) { - snprintf(err->data, err->dsize, "%s", - _("Not available in this menu.")); + snprintf(err->data, err->dsize, "%s", _("Not available in this menu.")); return -1; } for (idx = 0; MuttVars[idx].name; idx++) @@ -2379,8 +2376,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, { if (unset || inv || query) { - snprintf(err->data, err->dsize, "%s", - _("Usage: set variable=yes|no")); + snprintf(err->data, err->dsize, "%s", _("Usage: set variable=yes|no")); return -1; } @@ -2392,16 +2388,15 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, unset = 1; else { - snprintf(err->data, err->dsize, "%s", - _("Usage: set variable=yes|no")); + snprintf(err->data, err->dsize, "%s", _("Usage: set variable=yes|no")); return -1; } } if (query) { - snprintf(err->data, - err->dsize, *(bool *) MuttVars[idx].var ? _("%s is set") : _("%s is unset"), + snprintf(err->data, err->dsize, + *(bool *) MuttVars[idx].var ? _("%s is set") : _("%s is unset"), tmp->data); return 0; } @@ -2523,8 +2518,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, /* $charset can't be empty, others can */ ((strcmp(MuttVars[idx].name, "charset") == 0) && !*tmp->data)) { - snprintf(err->data, err->dsize, - _("Invalid value for option %s: \"%s\""), + snprintf(err->data, err->dsize, _("Invalid value for option %s: \"%s\""), MuttVars[idx].name, tmp->data); return -1; } @@ -2538,9 +2532,8 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, "show_multipart_alternative") == 0) && !valid_show_multipart_alternative(tmp->data)) { - snprintf(err->data, err->dsize, - _("Invalid value for name %s: \"%s\""), MuttVars[idx].name, - tmp->data); + snprintf(err->data, err->dsize, _("Invalid value for name %s: \"%s\""), + MuttVars[idx].name, tmp->data); return -1; } } @@ -2571,8 +2564,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, if (OPT_ATTACH_MSG && (mutt_str_strcmp(MuttVars[idx].name, "reply_regex") == 0)) { - snprintf(err->data, err->dsize, - "Operation not permitted when in attach-message mode."); + snprintf(err->data, err->dsize, "Operation not permitted when in attach-message mode."); r = -1; break; } @@ -3043,8 +3035,7 @@ static int parse_source(struct Buffer *tmp, struct Buffer *token, if (source_rc(path, err) < 0) { - snprintf(err->data, err->dsize, - _("source: file %s could not be sourced."), path); + snprintf(err->data, err->dsize, _("source: file %s could not be sourced."), path); return -1; } @@ -3768,7 +3759,9 @@ static int execute_commands(struct ListHead *p) static char *find_cfg(const char *home, const char *xdg_cfg_home) { const char *names[] = { - "neomuttrc", "muttrc", NULL, + "neomuttrc", + "muttrc", + NULL, }; const char *locations[][2] = { @@ -4020,7 +4013,8 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) #ifndef LOCALES_HACK /* Do we have a locale definition? */ - if (((p = mutt_str_getenv("LC_ALL")) != NULL && p[0]) || ((p = mutt_str_getenv("LANG")) != NULL && p[0]) || + if (((p = mutt_str_getenv("LC_ALL")) != NULL && p[0]) || + ((p = mutt_str_getenv("LANG")) != NULL && p[0]) || ((p = mutt_str_getenv("LC_CTYPE")) != NULL && p[0])) { OPT_LOCALES = true; diff --git a/init.h b/init.h index 396abd306f3..8d5050116a9 100644 --- a/init.h +++ b/init.h @@ -2276,7 +2276,7 @@ struct Option MuttVars[] = { ** (e.g. simply signed and ascii armored text). ** (PGP only) */ - { "pgp_default_key", DT_STRING, R_NONE, UL &PgpDefaultKey, 0 }, + { "pgp_default_key", DT_STRING, R_NONE, UL &PgpDefaultKey, 0 }, /* ** .pp ** This is the default key-pair to use for PGP operations. It will be @@ -4402,7 +4402,7 @@ struct Option MuttVars[] = { { "pgp_replyencrypt", DT_SYNONYM, R_NONE, UL "crypt_replyencrypt", 0 }, { "pgp_replysign", DT_SYNONYM, R_NONE, UL "crypt_replysign", 0 }, { "pgp_replysignencrypted", DT_SYNONYM, R_NONE, UL "crypt_replysignencrypted", 0 }, - { "pgp_self_encrypt_as", DT_SYNONYM, R_NONE, UL "pgp_default_key", 0 }, + { "pgp_self_encrypt_as", DT_SYNONYM, R_NONE, UL "pgp_default_key", 0 }, { "pgp_verify_sig", DT_SYNONYM, R_NONE, UL "crypt_verify_sig", 0 }, { "post_indent_str", DT_SYNONYM, R_NONE, UL "post_indent_string", 0 }, { "print_cmd", DT_SYNONYM, R_NONE, UL "print_command", 0 }, diff --git a/keymap.c b/keymap.c index 873127458e8..d87c0906bc5 100644 --- a/keymap.c +++ b/keymap.c @@ -1040,9 +1040,8 @@ static int try_bind(char *key, int menu, char *func, } if (err) { - snprintf(err->data, err->dsize, - _("Function '%s' not available for menu '%s'"), func, - mutt_map_get_name(menu, Menus)); + snprintf(err->data, err->dsize, _("Function '%s' not available for menu '%s'"), + func, mutt_map_get_name(menu, Menus)); } return -1; /* Couldn't find an existing function with this name */ } @@ -1257,8 +1256,7 @@ void mutt_what_key(void) { int ch; - mutt_window_mvprintw(MuttMessageWindow, 0, 0, - _("Enter keys (^G to abort): ")); + mutt_window_mvprintw(MuttMessageWindow, 0, 0, _("Enter keys (^G to abort): ")); do { ch = getch(); diff --git a/main.c b/main.c index 75edd4f81dd..66d91cf0d0c 100644 --- a/main.c +++ b/main.c @@ -389,7 +389,7 @@ int main(int argc, char **argv, char **env) snprintf(buf, sizeof(buf), "set news_server=%s", optarg); mutt_list_insert_tail(&commands, mutt_str_strdup(buf)); } - /* fallthrough */ + /* fallthrough */ case 'G': /* List of newsgroups */ flags |= MUTT_SELECT | MUTT_NEWS; diff --git a/mbox.c b/mbox.c index 6a29b0df9ae..a9d78d8f40c 100644 --- a/mbox.c +++ b/mbox.c @@ -330,7 +330,9 @@ static int mbox_parse_mailbox(struct Context *ctx) /* The test below avoids a potential integer overflow if the * content-length is huge (thus necessarily invalid). */ - tmploc = (curhdr->content->length < ctx->size) ? (loc + curhdr->content->length + 1) : -1; + tmploc = (curhdr->content->length < ctx->size) ? + (loc + curhdr->content->length + 1) : + -1; if ((tmploc > 0) && (tmploc < ctx->size)) { @@ -342,8 +344,7 @@ static int mbox_parse_mailbox(struct Context *ctx) fgets(buf, sizeof(buf), ctx->fp) == NULL || (mutt_str_strncmp("From ", buf, 5) != 0)) { - mutt_debug(1, - "bad content-length in message %d (cl=" OFF_T_FMT ")\n", + mutt_debug(1, "bad content-length in message %d (cl=" OFF_T_FMT ")\n", curhdr->index, curhdr->content->length); mutt_debug(1, "\tLINE: %s", buf); /* nope, return the previous position */ diff --git a/menu.c b/menu.c index 5a2ce9ebe90..2dcf07dd805 100644 --- a/menu.c +++ b/menu.c @@ -633,8 +633,7 @@ static void menu_length_jump(struct Menu *menu, int jumplen) } else { - mutt_error(neg ? _("You are on the first page.") : - _("You are on the last page.")); + mutt_error(neg ? _("You are on the first page.") : _("You are on the last page.")); } menu->current = MIN(menu->current, menu->max - 1); diff --git a/mh.c b/mh.c index 778766e8d16..7b199b2e54b 100644 --- a/mh.c +++ b/mh.c @@ -2538,8 +2538,7 @@ int maildir_check_empty(const char *path) /* we do "cur" on the first iteration since it's more likely that we'll * find old messages without having to scan both subdirs */ - snprintf(realpath, sizeof(realpath), "%s/%s", path, - iter == 0 ? "cur" : "new"); + snprintf(realpath, sizeof(realpath), "%s/%s", path, iter == 0 ? "cur" : "new"); dp = opendir(realpath); if (!dp) return -1; diff --git a/mutt/charset.c b/mutt/charset.c index 3e0e552e2e7..5c5123f16cd 100644 --- a/mutt/charset.c +++ b/mutt/charset.c @@ -61,8 +61,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -459,7 +459,7 @@ void mutt_ch_set_langinfo_charset(void) /** * mutt_ch_lookup_add - Add a new character set lookup - * @param type Type of character set, e.g. MUTT_LOOKUP_CHARSET + * @param type Type of character set, e.g. MUTT_LOOKUP_CHARSET * @param pat Pattern to match * @param replace Replacement string * @param err Buffer for error message @@ -690,7 +690,7 @@ const char *mutt_ch_iconv_lookup(const char *chs) * @param[in,out] ps String to convert * @param[in] from Current character set * @param[in] to Target character set - * @param[in] flags Flags, e.g. + * @param[in] flags Flags, e.g. * @retval 0 Success * @retval -1 Error * @@ -963,8 +963,8 @@ void mutt_ch_set_charset(char *charset) * @retval ptr Best performing charset * @retval NULL None could be found */ -char *mutt_ch_choose(const char *fromcode, const char *charsets, - char *u, size_t ulen, char **d, size_t *dlen) +char *mutt_ch_choose(const char *fromcode, const char *charsets, char *u, + size_t ulen, char **d, size_t *dlen) { char canonical_buf[LONG_STRING]; char *e = NULL, *tocode = NULL; @@ -1027,4 +1027,3 @@ char *mutt_ch_choose(const char *fromcode, const char *charsets, } return tocode; } - diff --git a/mutt/file.c b/mutt/file.c index 43c2c9497f3..ae690c119b4 100644 --- a/mutt/file.c +++ b/mutt/file.c @@ -400,7 +400,7 @@ int mutt_file_safe_rename(const char *src, const char *target) #ifdef EOPNOTSUPP || errno == EOPNOTSUPP #endif - ) + ) { mutt_debug(1, "trying rename...\n"); if (rename(src, target) == -1) diff --git a/mutt/idna.c b/mutt/idna.c index 5af815871fe..55748c4b348 100644 --- a/mutt/idna.c +++ b/mutt/idna.c @@ -165,8 +165,8 @@ char *mutt_idna_intl_to_local(const char *user, const char *domain, int flags) if (mutt_ch_convert_string(&reversed_user, Charset, "utf-8", 0) == -1) { - mutt_debug( - 1, "Not reversible. Charset conv to utf-8 failed for user = '%s'.\n", reversed_user); + mutt_debug(1, "Not reversible. Charset conv to utf-8 failed for user = '%s'.\n", + reversed_user); goto cleanup; } @@ -180,10 +180,8 @@ char *mutt_idna_intl_to_local(const char *user, const char *domain, int flags) if (mutt_ch_convert_string(&reversed_domain, Charset, "utf-8", 0) == -1) { - mutt_debug( - 1, - "Not reversible. Charset conv to utf-8 failed for domain = '%s'.\n", - reversed_domain); + mutt_debug(1, "Not reversible. Charset conv to utf-8 failed for domain = '%s'.\n", + reversed_domain); goto cleanup; } @@ -196,8 +194,8 @@ char *mutt_idna_intl_to_local(const char *user, const char *domain, int flags) { if (idna_to_ascii_8z(reversed_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS) { - mutt_debug( - 1, "Not reversible. idna_to_ascii_8z failed for domain = '%s'.\n", reversed_domain); + mutt_debug(1, "Not reversible. idna_to_ascii_8z failed for domain = '%s'.\n", + reversed_domain); goto cleanup; } mutt_str_replace(&reversed_domain, tmp); diff --git a/mutt/mbyte.c b/mutt/mbyte.c index 71daa854deb..99e875b9ab7 100644 --- a/mutt/mbyte.c +++ b/mutt/mbyte.c @@ -49,9 +49,9 @@ #include #include #include +#include "mbyte.h" #include "buffer.h" #include "charset.h" -#include "mbyte.h" #include "memory.h" #include "string2.h" diff --git a/mutt/md5.c b/mutt/md5.c index 6fddf0f99b0..5332b8cc6df 100644 --- a/mutt/md5.c +++ b/mutt/md5.c @@ -103,12 +103,12 @@ static void mutt_md5_process_block(const void *buffer, size_t len, struct Md5Ctx md5_uint32 C_save = C; md5_uint32 D_save = D; -/* First round: using the given function, the context and a constant the next - * context is computed. Because the algorithms processing unit is a 32-bit - * word and it is determined to work on words in little endian byte order we - * perhaps have to change the byte order before the computation. To reduce the - * work for the next steps we store the swapped words in the array - * CORRECT_WORDS. */ + /* First round: using the given function, the context and a constant the + * next context is computed. Because the algorithms processing unit is a + * 32-bit word and it is determined to work on words in little endian byte + * order we perhaps have to change the byte order before the computation. + * To reduce the work for the next steps we store the swapped words in the + * array CORRECT_WORDS. */ #define OP(a, b, c, d, s, T) \ do \ diff --git a/mutt/mime.c b/mutt/mime.c index 7e9d88f66d2..971315ae44c 100644 --- a/mutt/mime.c +++ b/mutt/mime.c @@ -56,16 +56,16 @@ const int IndexHex[128] = { * BodyTypes - Common MIME body types */ const char *const BodyTypes[] = { - "x-unknown", "audio", "application", "image", "message", - "model", "multipart", "text", "video", "*", + "x-unknown", "audio", "application", "image", "message", + "model", "multipart", "text", "video", "*", }; /** * BodyEncodings - Common MIME body encodings */ const char *const BodyEncodings[] = { - "x-unknown", "7bit", "8bit", "quoted-printable", - "base64", "binary", "x-uuencoded", + "x-unknown", "7bit", "8bit", "quoted-printable", + "base64", "binary", "x-uuencoded", }; /** diff --git a/mutt/parameter.c b/mutt/parameter.c index dcb7c3ccd98..1b9fbe47d22 100644 --- a/mutt/parameter.c +++ b/mutt/parameter.c @@ -113,7 +113,7 @@ char *mutt_param_get(const struct ParameterList *p, const char *s) * @note If a matching Parameter isn't found a new one will be allocated. * The new Parameter will be inserted at the front of the list. */ -void mutt_param_set(struct ParameterList* p, const char *attribute, const char *value) +void mutt_param_set(struct ParameterList *p, const char *attribute, const char *value) { if (!p) return; diff --git a/mutt/regex.c b/mutt/regex.c index 2c67af856fa..f7c0015b969 100644 --- a/mutt/regex.c +++ b/mutt/regex.c @@ -366,8 +366,9 @@ int mutt_replacelist_add(struct ReplaceList **rl, const char *pat, if (t->nmatch > t->regex->regex->re_nsub) { - snprintf(err->data, err->dsize, "%s", _("Not enough subexpressions for " - "template")); + snprintf(err->data, err->dsize, "%s", + _("Not enough subexpressions for " + "template")); mutt_replacelist_remove(rl, pat); return -1; } diff --git a/mutt/string.c b/mutt/string.c index 7038c0f5256..9b7ca0cfbfd 100644 --- a/mutt/string.c +++ b/mutt/string.c @@ -253,10 +253,10 @@ int mutt_str_atoi(const char *str, int *dst) * mutt_str_atoui - Convert ASCII string to an unsigned integer * @param[in] str String to read * @param[out] dst Store the result - * @retval 1 Successful conversion, with trailing characters - * @retval 0 Successful conversion - * @retval -1 Invalid input - * @retval -2 Input out of range + * @retval 1 Successful conversion, with trailing characters + * @retval 0 Successful conversion + * @retval -1 Invalid input + * @retval -2 Input out of range * * @note * This function's return value differs from the other functions. @@ -285,9 +285,9 @@ int mutt_str_atoui(const char *str, unsigned int *dst) * mutt_str_atoul - Convert ASCII string to an unsigned long * @param[in] str String to read * @param[out] dst Store the result - * @retval 1 Successful conversion, with trailing characters - * @retval 0 Successful conversion - * @retval -1 Invalid input + * @retval 1 Successful conversion, with trailing characters + * @retval 0 Successful conversion + * @retval -1 Invalid input * * @note * This function's return value differs from the other functions. @@ -987,7 +987,7 @@ const char *mutt_str_getenv(const char *name) const char *val = getenv(name); if (val && (val[0] != '\0')) - return val; + return val; return NULL; } diff --git a/mutt_lua.c b/mutt_lua.c index bb56580cf26..a8b4a2526a2 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -154,9 +154,10 @@ static int lua_mutt_set(lua_State *l) if ((opt.var != MUTT_YES) && (opt.var != MUTT_NO) && (opt.var != MUTT_ASKYES) && (opt.var != MUTT_ASKNO)) { - luaL_error(l, "Invalid opt for quad option %s (one of " - "mutt.QUAD_YES, mutt.QUAD_NO, mutt.QUAD_ASKYES, " - "mutt.QUAD_ASKNO", + luaL_error(l, + "Invalid opt for quad option %s (one of " + "mutt.QUAD_YES, mutt.QUAD_NO, mutt.QUAD_ASKYES, " + "mutt.QUAD_ASKNO", param); rc = -1; } @@ -320,8 +321,7 @@ static void lua_expose_command(void *p, const struct Command *cmd) { lua_State *l = (lua_State *) p; char buf[LONG_STRING]; - snprintf(buf, LONG_STRING, - "mutt.command.%s = function (...); mutt.call('%s', ...); end", + snprintf(buf, LONG_STRING, "mutt.command.%s = function (...); mutt.call('%s', ...); end", cmd->name, cmd->name); (void) luaL_dostring(l, buf); } diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 553ef767fc5..76ca5fc8b78 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -112,11 +112,11 @@ struct NmCtxData { notmuch_database_t *db; - struct Url db_url; /**< Parsed view url of the Notmuch database */ - char *db_url_holder; /**< The storage string used by db_url, we keep it + struct Url db_url; /**< Parsed view url of the Notmuch database */ + char *db_url_holder; /**< The storage string used by db_url, we keep it * to be able to free db_url */ - char *db_query; /**< Previous query */ - int db_limit; /**< Maximum number of results to return */ + char *db_query; /**< Previous query */ + int db_limit; /**< Maximum number of results to return */ enum NmQueryType query_type; /**< Messages or Threads */ struct Progress progress; /**< A progress bar */ @@ -491,9 +491,8 @@ static notmuch_database_t *do_database_open(const char *filename, bool writable, st = notmuch_database_open(filename, writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : NOTMUCH_DATABASE_MODE_READ_ONLY, &db); #else - db = notmuch_database_open(filename, - writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : - NOTMUCH_DATABASE_MODE_READ_ONLY); + db = notmuch_database_open(filename, writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : + NOTMUCH_DATABASE_MODE_READ_ONLY); #endif if (db || !NmOpenTimeout || ((ct / 2) > NmOpenTimeout)) break; @@ -1579,8 +1578,7 @@ int nm_read_entire_thread(struct Context *ctx, struct Header *h) mutt_message(_("No more messages in the thread.")); data->oldmsgcount = 0; - mutt_debug(1, - "nm: reading entire-thread messages... done [rc=%d, count=%d]\n", + mutt_debug(1, "nm: reading entire-thread messages... done [rc=%d, count=%d]\n", rc, ctx->msgcount); return rc; } diff --git a/mutt_signal.c b/mutt_signal.c index b2935891289..a417b793562 100644 --- a/mutt_signal.c +++ b/mutt_signal.c @@ -48,7 +48,7 @@ static void curses_signal_handler(int sig) if (!IsEndwin) endwin(); kill(0, SIGSTOP); - /* fallthrough */ + /* fallthrough */ case SIGCONT: if (!IsEndwin) diff --git a/muttlib.c b/muttlib.c index aeadb34f2a5..fb01225f52b 100644 --- a/muttlib.c +++ b/muttlib.c @@ -66,12 +66,13 @@ #endif static const char *xdg_env_vars[] = { - [XDG_CONFIG_HOME] = "XDG_CONFIG_HOME", - [XDG_CONFIG_DIRS] = "XDG_CONFIG_DIRS", + [XDG_CONFIG_HOME] = "XDG_CONFIG_HOME", + [XDG_CONFIG_DIRS] = "XDG_CONFIG_DIRS", }; static const char *xdg_defaults[] = { - [XDG_CONFIG_HOME] = "~/.config", [XDG_CONFIG_DIRS] = "/etc/xdg", + [XDG_CONFIG_HOME] = "~/.config", + [XDG_CONFIG_DIRS] = "/etc/xdg", }; /** @@ -205,7 +206,7 @@ char *mutt_expand_path_regex(char *s, size_t slen, int regex) } break; - /* elm compatibility, @ expands alias to user name */ + /* elm compatibility, @ expands alias to user name */ case '@': { @@ -474,8 +475,9 @@ 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", + 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) @@ -1589,4 +1591,3 @@ int mutt_inbox_cmp(const char *a, const char *b) return 0; } - diff --git a/mx.c b/mx.c index 3a2108cd375..e32cd87f62e 100644 --- a/mx.c +++ b/mx.c @@ -729,8 +729,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) if (ctx->deleted && !(ctx->magic == MUTT_MAILDIR && MaildirTrash)) { snprintf(buf, sizeof(buf), - ctx->deleted == 1 ? _("Purge %d deleted message?") : - _("Purge %d deleted messages?"), + ctx->deleted == 1 ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"), ctx->deleted); purge = query_quadoption(Delete, buf); if (purge == MUTT_ABORT) @@ -1034,8 +1033,7 @@ int mx_sync_mailbox(struct Context *ctx, int *index_hint) char buf[SHORT_STRING]; snprintf(buf, sizeof(buf), - ctx->deleted == 1 ? _("Purge %d deleted message?") : - _("Purge %d deleted messages?"), + ctx->deleted == 1 ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"), ctx->deleted); purge = query_quadoption(Delete, buf); if (purge == MUTT_ABORT) diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 2a395096a08..4cf1795cd93 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -155,8 +155,7 @@ int mutt_protect(struct Header *msg, char *keylist) return -1; } } - else if (!mutt_str_strcasecmp("flowed", - mutt_param_get(&msg->content->parameter, "format"))) + else if (!mutt_str_strcasecmp("flowed", mutt_param_get(&msg->content->parameter, "format"))) { if ((query_quadoption(PgpMimeAuto, _("Inline PGP can't be used with format=flowed. " @@ -971,8 +970,9 @@ int mutt_signed_handler(struct Body *a, struct State *s) if (!signed_type) { /* A null protocol value is already checked for in mutt_body_handler() */ - state_printf(s, _("[-- Error: " - "Unknown multipart/signed protocol %s! --]\n\n"), + state_printf(s, + _("[-- Error: " + "Unknown multipart/signed protocol %s! --]\n\n"), mutt_param_get(&b->parameter, "protocol")); return mutt_body_handler(a, s); } @@ -1049,8 +1049,9 @@ int mutt_signed_handler(struct Body *a, struct State *s) continue; } - state_printf(s, _("[-- Warning: " - "We can't verify %s/%s signatures. --]\n\n"), + state_printf(s, + _("[-- Warning: " + "We can't verify %s/%s signatures. --]\n\n"), TYPE(signatures[i]), signatures[i]->subtype); } } diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 051ccee4fd4..1690c461e56 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -1058,8 +1058,7 @@ static struct Body *sign_message(struct Body *a, int use_smime) mutt_generate_boundary(&t->parameter); mutt_param_set(&t->parameter, "protocol", - use_smime ? "application/pkcs7-signature" : - "application/pgp-signature"); + use_smime ? "application/pkcs7-signature" : "application/pgp-signature"); /* Get the micalg from gpgme. Old gpgme versions don't support this for S/MIME so we assume sha-1 in this case. */ if (!get_micalg(ctx, use_smime, buf, sizeof(buf))) @@ -1573,9 +1572,8 @@ static int show_one_sig_status(gpgme_ctx_t ctx, int idx, struct State *s) ; /* No state information so no way to print anything. */ else if (err) { - snprintf(buf, sizeof(buf), - _("Error getting key information for KeyID %s: %s\n"), fpr, - gpgme_strerror(err)); + snprintf(buf, sizeof(buf), _("Error getting key information for KeyID %s: %s\n"), + fpr, gpgme_strerror(err)); state_puts(buf, s); anybad = true; } diff --git a/ncrypt/cryptglue.c b/ncrypt/cryptglue.c index caab8414400..456d47dc569 100644 --- a/ncrypt/cryptglue.c +++ b/ncrypt/cryptglue.c @@ -75,7 +75,7 @@ void crypt_init(void) #else 1 #endif - ) + ) crypto_module_register(&crypt_mod_pgp_classic); #endif @@ -86,7 +86,7 @@ void crypt_init(void) #else 1 #endif - ) + ) crypto_module_register(&crypt_mod_smime_classic); #endif diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index ac5fa88cc34..b684878ebea 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -538,8 +538,7 @@ int pgp_application_pgp_handler(struct Body *m, struct State *s) { struct FgetConv *fc = NULL; int ch; - char *expected_charset = - gpgcharset && *gpgcharset ? gpgcharset : "utf-8"; + char *expected_charset = gpgcharset && *gpgcharset ? gpgcharset : "utf-8"; mutt_debug(4, "pgp: recoding inline from [%s] to [%s]\n", expected_charset, Charset); diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index a25d5204ac3..b49c6ad1b4d 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -152,10 +152,9 @@ static void mutt_pgp_command(char *buf, size_t buflen, * Glue. */ -static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, - int pgpoutfd, int pgperrfd, short need_passphrase, - const char *fname, const char *sig_fname, - const char *ids, const char *format) +static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, + int pgperrfd, short need_passphrase, const char *fname, + const char *sig_fname, const char *ids, const char *format) { struct PgpCommandContext cctx; char cmd[HUGE_STRING]; diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 81ddade1374..91c3077d6d6 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -651,8 +651,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, break; } - snprintf(buf2, sizeof(buf2), - _("%s Do you really want to use the key?"), _(str)); + snprintf(buf2, sizeof(buf2), _("%s Do you really want to use the key?"), _(str)); if (mutt_yesorno(buf2, MUTT_NO) != MUTT_YES) { diff --git a/ncrypt/pgppacket.c b/ncrypt/pgppacket.c index 82fa5f8371a..8970a46fa71 100644 --- a/ncrypt/pgppacket.c +++ b/ncrypt/pgppacket.c @@ -169,7 +169,7 @@ unsigned char *pgp_read_packet(FILE *fp, size_t *len) case 1: bytes = 2; - /* fallthrough */ + /* fallthrough */ case 2: { diff --git a/nntp.c b/nntp.c index ba2933b4ede..196f971ec82 100644 --- a/nntp.c +++ b/nntp.c @@ -679,9 +679,8 @@ int nntp_open_connection(struct NntpServer *nserv) { if (nserv->use_tls == 0) nserv->use_tls = - SslForceTls || - query_quadoption(SslStarttls, - _("Secure connection with TLS?")) == MUTT_YES ? + SslForceTls || query_quadoption(SslStarttls, + _("Secure connection with TLS?")) == MUTT_YES ? 2 : 1; if (nserv->use_tls == 2) diff --git a/pager.c b/pager.c index 932e15d9a8f..29ee0bf942c 100644 --- a/pager.c +++ b/pager.c @@ -839,7 +839,8 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, } else if (check_sig(buf, line_info, n - 1) == 0) line_info[n].type = MT_COLOR_SIGNATURE; - else if (QuoteRegex && QuoteRegex->regex && regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0) + else if (QuoteRegex && QuoteRegex->regex && + regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0) { if (Smileys && Smileys->regex && (regexec(Smileys->regex, buf, 1, smatch, 0) == 0)) { @@ -1488,11 +1489,12 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, (*last)--; goto out; } - if (QuoteRegex && QuoteRegex->regex && regexec(QuoteRegex->regex, (char *) fmt, 1, pmatch, 0) == 0) + if (QuoteRegex && QuoteRegex->regex && + regexec(QuoteRegex->regex, (char *) fmt, 1, pmatch, 0) == 0) { (*line_info)[n].quote = classify_quote(quote_list, (char *) fmt + pmatch[0].rm_so, - pmatch[0].rm_eo - pmatch[0].rm_so, force_redraw, q_level); + pmatch[0].rm_eo - pmatch[0].rm_so, force_redraw, q_level); } else { @@ -1671,7 +1673,10 @@ static int up_n_lines(int nlines, struct Line *info, int cur, int hiding) } static const struct Mapping PagerHelp[] = { - { N_("Exit"), OP_EXIT }, { N_("PrevPg"), OP_PREV_PAGE }, { N_("NextPg"), OP_NEXT_PAGE }, { NULL, 0 }, + { N_("Exit"), OP_EXIT }, + { N_("PrevPg"), OP_PREV_PAGE }, + { N_("NextPg"), OP_NEXT_PAGE }, + { NULL, 0 }, }; static const struct Mapping PagerHelpExtra[] = { { N_("View Attachm."), OP_VIEW_ATTACHMENTS }, @@ -2451,8 +2456,8 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e break; } - /* no previous search pattern */ - /* fallthrough */ + /* no previous search pattern */ + /* fallthrough */ case OP_SEARCH: case OP_SEARCH_REVERSE: @@ -2703,7 +2708,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e km_error_key(MENU_PAGER); break; - /* -------------------------------------------------------------------- + /* -------------------------------------------------------------------- * The following are operations on the current message rather than * adjusting the view of the message. */ diff --git a/parse.c b/parse.c index a2f37628339..219db043318 100644 --- a/parse.c +++ b/parse.c @@ -129,8 +129,7 @@ int mutt_check_encoding(const char *c) return ENC8BIT; else if (mutt_str_strncasecmp("binary", c, sizeof("binary") - 1) == 0) return ENCBINARY; - else if (mutt_str_strncasecmp("quoted-printable", c, - sizeof("quoted-printable") - 1) == 0) + else if (mutt_str_strncasecmp("quoted-printable", c, sizeof("quoted-printable") - 1) == 0) { return ENCQUOTEDPRINTABLE; } @@ -1280,7 +1279,8 @@ struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr, mutt_rfc2047_decode(&e->subject); - if (ReplyRegex && ReplyRegex->regex && (regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0) == 0)) + 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 a7102735402..400de908a60 100644 --- a/pattern.c +++ b/pattern.c @@ -248,11 +248,11 @@ enum RangeType }; static struct RangeRegex range_regexes[] = { - [RANGE_K_REL] = {.raw = RANGE_REL_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, - [RANGE_K_ABS] = {.raw = RANGE_ABS_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, - [RANGE_K_LT] = {.raw = RANGE_LT_RX, .lgrp = 1, .rgrp = 2, .ready = 0 }, - [RANGE_K_GT] = {.raw = RANGE_GT_RX, .lgrp = 2, .rgrp = 1, .ready = 0 }, - [RANGE_K_BARE] = {.raw = RANGE_BARE_RX, .lgrp = 1, .rgrp = 1, .ready = 0 }, + [RANGE_K_REL] = { .raw = RANGE_REL_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, + [RANGE_K_ABS] = { .raw = RANGE_ABS_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, + [RANGE_K_LT] = { .raw = RANGE_LT_RX, .lgrp = 1, .rgrp = 2, .ready = 0 }, + [RANGE_K_GT] = { .raw = RANGE_GT_RX, .lgrp = 2, .rgrp = 1, .ready = 0 }, + [RANGE_K_BARE] = { .raw = RANGE_BARE_RX, .lgrp = 1, .rgrp = 1, .ready = 0 }, }; #define KILO 1024 @@ -633,11 +633,11 @@ static bool is_context_available(struct Buffer *s, regmatch_t pmatch[], { char *context_loc = NULL; const char *context_req_chars[] = { - [RANGE_K_REL] = ".0123456789", - [RANGE_K_ABS] = ".", - [RANGE_K_LT] = "", - [RANGE_K_GT] = "", - [RANGE_K_BARE] = ".", + [RANGE_K_REL] = ".0123456789", + [RANGE_K_ABS] = ".", + [RANGE_K_LT] = "", + [RANGE_K_GT] = "", + [RANGE_K_BARE] = ".", }; /* First decide if we're going to need the context at all. diff --git a/postpone.c b/postpone.c index 6facda20081..4507192fc6b 100644 --- a/postpone.c +++ b/postpone.c @@ -602,8 +602,9 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, { newhdr->security |= SIGN; if ((WithCrypto & APPLICATION_PGP) && - (mutt_str_strcasecmp(mutt_param_get(&newhdr->content->parameter, "protocol"), - "application/pgp-signature") == 0)) + (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; @@ -653,7 +654,8 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, if (b->type == TYPETEXT) { - if (mutt_str_strcasecmp("yes", mutt_param_get(&b->parameter, "x-mutt-noconv")) == 0) + if (mutt_str_strcasecmp("yes", + mutt_param_get(&b->parameter, "x-mutt-noconv")) == 0) b->noconv = true; else { diff --git a/recvattach.c b/recvattach.c index c066a2ad178..93534d86a74 100644 --- a/recvattach.c +++ b/recvattach.c @@ -829,9 +829,8 @@ void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, stru struct State state = { 0 }; pid_t thepid; - if (query_quadoption(Print, - tag ? _("Print tagged attachment(s)?") : - _("Print attachment?")) != MUTT_YES) + if (query_quadoption(Print, tag ? _("Print tagged attachment(s)?") : + _("Print attachment?")) != MUTT_YES) return; if (!AttachSplit) @@ -908,7 +907,7 @@ int mutt_attach_display_loop(struct Menu *menu, int op, struct Header *hdr, { case OP_DISPLAY_HEADERS: Weed = !Weed; - /* fallthrough */ + /* fallthrough */ case OP_VIEW_ATTACH: op = mutt_view_attachment(CURATTACH->fp, CURATTACH->content, MUTT_REGULAR, hdr, actx); diff --git a/recvcmd.c b/recvcmd.c index d3d33075a43..c7a3f85c325 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -231,8 +231,7 @@ void mutt_attach_bounce(FILE *fp, struct AttachCtx *actx, struct Body *cur) if (!ret) mutt_message(p ? _("Message bounced.") : _("Messages bounced.")); else - mutt_error(p ? _("Error bouncing message!") : - _("Error bouncing messages!")); + mutt_error(p ? _("Error bouncing message!") : _("Error bouncing messages!")); mutt_addr_free(&addr); } diff --git a/rfc2047.c b/rfc2047.c index 0c710002d40..7a2c1d42007 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -22,10 +22,10 @@ */ #include "config.h" -#include "globals.h" #include "mutt/charset.h" #include "mutt/rfc2047.h" #include "address.h" +#include "globals.h" #include diff --git a/send.c b/send.c index 07096d24c52..fb3704cd521 100644 --- a/send.c +++ b/send.c @@ -582,8 +582,7 @@ int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags) if ((flags & (SENDLISTREPLY | SENDGROUPREPLY)) && in->mail_followup_to) { snprintf(prompt, sizeof(prompt), _("Follow-up to %s%s?"), - in->mail_followup_to->mailbox, - in->mail_followup_to->next ? ",..." : ""); + in->mail_followup_to->mailbox, in->mail_followup_to->next ? ",..." : ""); hmfupto = query_quadoption(HonorFollowupTo, prompt); if (hmfupto == MUTT_ABORT) @@ -1872,10 +1871,9 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, mutt_prepare_envelope(msg->env, 0); mutt_env_to_intl(msg->env, NULL, NULL); /* Handle bad IDNAs the next time. */ - if (!Postponed || - mutt_write_fcc(NONULL(Postponed), msg, - (cur && (flags & SENDREPLY)) ? cur->env->message_id : NULL, - 1, fcc, NULL) < 0) + if (!Postponed || mutt_write_fcc(NONULL(Postponed), msg, + (cur && (flags & SENDREPLY)) ? cur->env->message_id : NULL, + 1, fcc, NULL) < 0) { msg->content = mutt_remove_multipart(msg->content); decode_descriptions(msg->content); @@ -2016,7 +2014,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, mutt_expand_path(fcc, sizeof(fcc)); -/* Don't save a copy when we are in batch-mode, and the FCC + /* Don't save a copy when we are in batch-mode, and the FCC * folder is on an IMAP server: This would involve possibly lots * of user interaction, which is not available in batch mode. * diff --git a/sendlib.c b/sendlib.c index 39782c383d4..f93e1fe9205 100644 --- a/sendlib.c +++ b/sendlib.c @@ -336,7 +336,8 @@ int mutt_write_mime_header(struct Body *a, FILE *f) * even when they aren't needed. */ - if ((mutt_str_strcasecmp(np->attribute, "boundary") == 0) && (strcmp(buffer, tmp) == 0)) + if ((mutt_str_strcasecmp(np->attribute, "boundary") == 0) && + (strcmp(buffer, tmp) == 0)) snprintf(buffer, sizeof(buffer), "\"%s\"", tmp); FREE(&tmp); @@ -967,8 +968,7 @@ struct Content *mutt_get_content_info(const char *fname, struct Body *b) 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")); + Charset && !mutt_ch_is_us_ascii(Charset) ? Charset : "unknown-8bit")); return info; } diff --git a/status.c b/status.c index c962db9d884..bb5fcb46f54 100644 --- a/status.c +++ b/status.c @@ -259,13 +259,15 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c if (Context) { - i = OPT_ATTACH_MSG ? 3 : ((Context->readonly || Context->dontwrite) ? - 2 : - (Context->changed || - /* deleted doesn't necessarily mean changed in IMAP */ - (Context->magic != MUTT_IMAP && Context->deleted)) ? - 1 : - 0); + i = OPT_ATTACH_MSG ? + 3 : + ((Context->readonly || Context->dontwrite) ? + 2 : + (Context->changed || + /* deleted doesn't necessarily mean changed in IMAP */ + (Context->magic != MUTT_IMAP && Context->deleted)) ? + 1 : + 0); } if (!StatusChars || !StatusChars->len) diff --git a/system.c b/system.c index da87a7d6ba5..22c6cdc538e 100644 --- a/system.c +++ b/system.c @@ -23,8 +23,8 @@ #include "config.h" #include #include -#include #include +#include #include "mutt/mutt.h" #include "mutt.h" #include "protos.h"