From: Richard Russon Date: Wed, 6 Sep 2017 18:40:12 +0000 (+0100) Subject: clang-format X-Git-Tag: neomutt-20170907^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a8c6c04a67eb703869618b03bcff5d7e8a93c67;p=neomutt clang-format --- diff --git a/.clang-format b/.clang-format index 46d57ff5a..a1e7be2a8 100644 --- a/.clang-format +++ b/.clang-format @@ -8,15 +8,17 @@ ColumnLimit: 80 BreakBeforeBraces: Allman IncludeCategories: - - Regex: '"config.h"' + - Regex: '"config\.h"' Priority: -10 - - Regex: '' - Priority: -5 + - Regex: '' + Priority: -8 - Regex: '<.*>' + Priority: -7 + - Regex: '".*_private\.h"' + Priority: -6 + - Regex: '"lib/.*\.h"' Priority: -4 - - Regex: '".*_private.h"' - Priority: -3 - - Regex: '"mutt.h"' + - Regex: '"mutt\.h"' Priority: -2 # Main Header 0 - Regex: '".*"' diff --git a/account.c b/account.c index c8fc17bb5..ed82ed7fb 100644 --- a/account.c +++ b/account.c @@ -23,10 +23,10 @@ #include "config.h" #include #include +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "globals.h" -#include "lib/lib.h" #include "options.h" #include "protos.h" #include "url.h" diff --git a/addrbook.c b/addrbook.c index dc3d56c42..3723ac8bd 100644 --- a/addrbook.c +++ b/addrbook.c @@ -24,13 +24,13 @@ #include #include #include +#include "lib/lib.h" +#include "mutt.h" #include "address.h" #include "alias.h" #include "format_flags.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" -#include "mutt.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "opcodes.h" @@ -86,8 +86,8 @@ static const char *alias_format_str(char *dest, size_t destlen, size_t col, int static void alias_entry(char *s, size_t slen, struct Menu *m, int num) { mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str, - (unsigned long) ((struct Alias **) m->data)[num], - MUTT_FORMAT_ARROWCURSOR); + (unsigned long) ((struct Alias **) m->data)[num], + MUTT_FORMAT_ARROWCURSOR); } static int alias_tag(struct Menu *menu, int n, int m) diff --git a/alias.c b/alias.c index 5d42ae537..b9f1415c8 100644 --- a/alias.c +++ b/alias.c @@ -32,13 +32,13 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "alias.h" #include "address.h" +#include "alias.h" #include "charset.h" #include "envelope.h" #include "globals.h" -#include "lib/lib.h" #include "list.h" #include "mutt_curses.h" #include "mutt_idna.h" @@ -647,7 +647,8 @@ bool mutt_addr_is_user(struct Address *addr) } if (string_is_address(addr->mailbox, Username, ShortHostname)) { - mutt_debug(5, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, ShortHostname); + mutt_debug(5, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, + Username, ShortHostname); return true; } fqdn = mutt_fqdn(0); diff --git a/attach.c b/attach.c index a76c73af0..faef0b1db 100644 --- a/attach.c +++ b/attach.c @@ -28,6 +28,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "attach.h" #include "body.h" @@ -36,7 +37,6 @@ #include "filter.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" @@ -1091,7 +1091,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a) mutt_any_key_to_continue(NULL); rc = 1; } -bail0: + bail0: safe_fclose(&ifp); safe_fclose(&fpout); mutt_unlink(newfile); diff --git a/bcache.c b/bcache.c index 51029c971..2699c8206 100644 --- a/bcache.c +++ b/bcache.c @@ -29,10 +29,10 @@ #include #include #include +#include "lib/lib.h" #include "bcache.h" #include "account.h" #include "globals.h" -#include "lib/lib.h" #include "protos.h" #include "url.h" diff --git a/body.c b/body.c index 4551735ea..8e0941217 100644 --- a/body.c +++ b/body.c @@ -24,14 +24,14 @@ #include #include #include +#include "lib/debug.h" +#include "lib/memory.h" +#include "lib/string2.h" #include "body.h" #include "header.h" #include "mime.h" #include "parameter.h" #include "protos.h" -#include "lib/debug.h" -#include "lib/memory.h" -#include "lib/string2.h" struct Body *mutt_new_body(void) { @@ -160,4 +160,3 @@ void mutt_free_body(struct Body **p) *p = 0; } - diff --git a/browser.c b/browser.c index 750ea90f2..fa01c9c38 100644 --- a/browser.c +++ b/browser.c @@ -39,18 +39,18 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "browser.h" #include "account.h" #include "attach.h" #include "body.h" +#include "browser.h" #include "buffy.h" #include "charset.h" #include "context.h" #include "format_flags.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "mailbox.h" #include "mbyte.h" #include "mutt_curses.h" @@ -538,10 +538,10 @@ static const char *newsgroup_format_str(char *dest, size_t destlen, size_t col, { if (folder->ff->nd->unread != 0) mutt_expando_format(dest, destlen, col, cols, ifstring, - newsgroup_format_str, data, flags); + newsgroup_format_str, data, flags); else mutt_expando_format(dest, destlen, col, cols, elsestring, - newsgroup_format_str, data, flags); + newsgroup_format_str, data, flags); } else if (Context && Context->data == folder->ff->nd) { @@ -902,12 +902,13 @@ static void folder_entry(char *s, size_t slen, struct Menu *menu, int num) #ifdef USE_NNTP if (option(OPT_NEWS)) - mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(GroupIndexFormat), newsgroup_format_str, - (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); + mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, + NONULL(GroupIndexFormat), newsgroup_format_str, + (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); else #endif mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), - folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); + folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); } #ifdef USE_NOTMUCH @@ -919,7 +920,7 @@ static void vfolder_entry(char *s, size_t slen, struct Menu *menu, int num) folder.num = num; mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(VfolderFormat), - folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); + folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); } #endif @@ -1307,7 +1308,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf #ifdef USE_NNTP option(OPT_NEWS) ? FolderNewsHelp : #endif - FolderHelp); + FolderHelp); mutt_push_current_menu(menu); init_menu(&state, menu, title, sizeof(title), buffy); diff --git a/buffy.c b/buffy.c index 4a4b0be6e..f894929a0 100644 --- a/buffy.c +++ b/buffy.c @@ -29,14 +29,14 @@ #include #include #include +#include "lib/lib.h" +#include "mutt.h" #include "buffy.h" #include "context.h" #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" -#include "mutt.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mx.h" diff --git a/charset.c b/charset.c index 0a2d9a617..5f4adc871 100644 --- a/charset.c +++ b/charset.c @@ -27,10 +27,10 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "charset.h" #include "globals.h" -#include "lib/lib.h" #include "protos.h" #ifndef EILSEQ diff --git a/color.c b/color.c index a3b6f18af..f9baf4ce7 100644 --- a/color.c +++ b/color.c @@ -26,12 +26,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "context.h" #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mutt_regex.h" @@ -408,7 +408,8 @@ static int parse_color_name(const char *s, int *col, int *attr, int is_fg, struc { s += 5; *col = strtol(s, &eptr, 10); - if (!*s || *eptr || *col < 0 || (*col >= COLORS && !option(OPT_NO_CURSES) && has_colors())) + if (!*s || *eptr || *col < 0 || + (*col >= COLORS && !option(OPT_NO_CURSES) && has_colors())) { snprintf(err->data, err->dsize, _("%s: color not supported by term"), s); return -1; @@ -878,9 +879,9 @@ static int _mutt_parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer #ifdef HAVE_USE_DEFAULT_COLORS if (!option(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) - /* the case of the tree object is special, because a non-default + && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT || object == MT_COLOR_TREE) && + use_default_colors() != OK) + /* the case of the tree object is special, because a non-default * fg color of the tree element may be combined dynamically with * the default bg color of an index line, not necessarily defined in * a rc file. diff --git a/commands.c b/commands.c index 981eb21a4..4063b6b64 100644 --- a/commands.c +++ b/commands.c @@ -34,6 +34,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "body.h" @@ -46,7 +47,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mailbox.h" #include "mime.h" #include "mutt_curses.h" @@ -985,8 +985,7 @@ 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_strcasecmp(tmp, obuf); - charset_changed = - mutt_strcasecmp(charset, mutt_get_parameter("charset", b->parameter)); + charset_changed = mutt_strcasecmp(charset, mutt_get_parameter("charset", b->parameter)); /* if in send mode, check for conversion - current setting is default. */ diff --git a/complete.c b/complete.c index 45e63beb8..d392399ec 100644 --- a/complete.c +++ b/complete.c @@ -26,8 +26,8 @@ #include #include #include -#include "globals.h" #include "lib/lib.h" +#include "globals.h" #include "options.h" #include "protos.h" #ifdef USE_IMAP diff --git a/compose.c b/compose.c index 1ac1afff1..32585e9cc 100644 --- a/compose.c +++ b/compose.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "attach.h" @@ -43,7 +44,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" @@ -746,7 +746,8 @@ static const char *compose_format_str(char *buf, size_t buflen, size_t col, int static void compose_status_line(char *buf, size_t buflen, size_t col, int cols, struct Menu *menu, const char *p) { - mutt_expando_format(buf, buflen, col, cols, p, compose_format_str, (unsigned long) menu, 0); + mutt_expando_format(buf, buflen, col, cols, p, compose_format_str, + (unsigned long) menu, 0); } /** diff --git a/compress.c b/compress.c index 0f7b0636b..6e5b4763c 100644 --- a/compress.c +++ b/compress.c @@ -27,12 +27,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "compress.h" #include "context.h" #include "format_flags.h" #include "globals.h" -#include "lib/lib.h" #include "mailbox.h" #include "mutt_curses.h" #include "mx.h" diff --git a/copy.c b/copy.c index ac6f59b0d..e84a12415 100644 --- a/copy.c +++ b/copy.c @@ -25,6 +25,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "copy.h" #include "address.h" @@ -33,7 +34,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" diff --git a/curs_lib.c b/curs_lib.c index cc37a06a7..441f66ce9 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -41,10 +41,10 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "enter_state.h" #include "globals.h" -#include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -740,7 +740,7 @@ int mutt_window_mvprintw(struct MuttWindow *win, int row, int col, const char *f va_list ap; int rv; - if ((rv = mutt_window_move (win, row, col)) != ERR) + if ((rv = mutt_window_move(win, row, col)) != ERR) { va_start(ap, fmt); rv = vw_printw(stdscr, fmt, ap); diff --git a/curs_main.c b/curs_main.c index e3161d98b..358ee8234 100644 --- a/curs_main.c +++ b/curs_main.c @@ -31,6 +31,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "body.h" @@ -41,7 +42,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mutt_curses.h" @@ -133,7 +133,7 @@ static const char *No_visible = N_("No visible messages."); } #define CHECK_ATTACH \ - if (option(OPT_ATTACH_MSG)) \ + if (option(OPT_ATTACH_MSG)) \ { \ mutt_flushinp(); \ mutt_error(_(Function_not_permitted_in_attach_message_mode)); \ @@ -145,7 +145,7 @@ static const char *No_visible = N_("No visible messages."); #define FLAGGED(h) mutt_thread_contains_flagged(Context, h) #define CAN_COLLAPSE(header) \ - ((option(OPT_COLLAPSE_UNREAD) || !UNREAD(header)) && \ + ((option(OPT_COLLAPSE_UNREAD) || !UNREAD(header)) && \ (option(OPT_COLLAPSE_FLAGGED) || !FLAGGED(header))) /* de facto standard escapes for tsl/fsl */ @@ -2139,7 +2139,8 @@ int mutt_index_menu(void) menu->current = mutt_thread_next_unread(Context, CURHDR); } - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); int hint = Context->hdrs[Context->v2r[menu->current]]->index; @@ -2858,7 +2859,8 @@ int mutt_index_menu(void) /* L10N: CHECK_ACL */ CHECK_ACL(MUTT_ACL_INSERT, _("Cannot edit message")); - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); mutt_edit_message(Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; @@ -2870,7 +2872,8 @@ int mutt_index_menu(void) CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_ATTACH; - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); ci_send_message(SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; @@ -2885,7 +2888,8 @@ int mutt_index_menu(void) CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_ATTACH; - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); ci_send_message(SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; @@ -2919,7 +2923,8 @@ int mutt_index_menu(void) CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); ci_send_message(SENDREPLY | SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; @@ -3128,7 +3133,8 @@ int mutt_index_menu(void) CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; - if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) + if (option(OPT_PGP_AUTO_DECODE) && + (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw); ci_send_message(SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR); menu->redraw = REDRAW_FULL; diff --git a/edit.c b/edit.c index 2711009c0..b9ca127af 100644 --- a/edit.c +++ b/edit.c @@ -33,6 +33,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "body.h" @@ -40,7 +41,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_idna.h" #include "options.h" diff --git a/editmsg.c b/editmsg.c index 0afa42628..daa435d91 100644 --- a/editmsg.c +++ b/editmsg.c @@ -31,12 +31,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "context.h" #include "copy.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" #include "mx.h" #include "options.h" diff --git a/enter.c b/enter.c index ad5162591..0e86642a2 100644 --- a/enter.c +++ b/enter.c @@ -27,12 +27,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "enter_state.h" #include "globals.h" #include "history.h" #include "keymap.h" -#include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "opcodes.h" diff --git a/envelope.c b/envelope.c index 196019555..7001bcb80 100644 --- a/envelope.c +++ b/envelope.c @@ -21,10 +21,10 @@ */ #include "config.h" -#include "envelope.h" #include #include "lib/buffer.h" #include "lib/memory.h" +#include "envelope.h" #include "queue.h" #include "rfc822.h" @@ -94,7 +94,7 @@ void mutt_merge_envelopes(struct Envelope *base, struct Envelope **extra) #define MOVE_STAILQ(h) \ if (STAILQ_EMPTY(&base->h)) \ { \ - STAILQ_SWAP(&base->h, &((*extra))->h, ListNode); \ + STAILQ_SWAP(&base->h, &((*extra))->h, ListNode); \ } MOVE_ELEM(return_path); @@ -140,4 +140,3 @@ void mutt_merge_envelopes(struct Envelope *base, struct Envelope **extra) mutt_free_envelope(extra); } - diff --git a/flags.c b/flags.c index ceb7a2fb3..20ad291ec 100644 --- a/flags.c +++ b/flags.c @@ -23,11 +23,11 @@ #include "config.h" #include #include +#include "lib/lib.h" #include "mutt.h" #include "context.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mx.h" @@ -131,7 +131,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int update = true; h->old = false; if (upd_ctx) - ctx->new++; + ctx->new ++; if (h->read) { h->read = false; @@ -148,7 +148,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int update = true; if (!h->old) if (upd_ctx) - ctx->new--; + ctx->new --; h->read = true; if (upd_ctx) ctx->unread--; @@ -171,7 +171,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int h->old = true; if (!h->read) if (upd_ctx) - ctx->new--; + ctx->new --; h->changed = true; if (upd_ctx) ctx->changed = true; @@ -183,7 +183,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int h->old = false; if (!h->read) if (upd_ctx) - ctx->new++; + ctx->new ++; h->changed = true; if (upd_ctx) ctx->changed = true; @@ -205,7 +205,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int ctx->unread--; if (!h->old) if (upd_ctx) - ctx->new--; + ctx->new --; h->changed = true; if (upd_ctx) ctx->changed = true; @@ -219,7 +219,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int ctx->unread++; if (!h->old) if (upd_ctx) - ctx->new++; + ctx->new ++; h->changed = true; if (upd_ctx) ctx->changed = true; @@ -244,7 +244,7 @@ void _mutt_set_flag(struct Context *ctx, struct Header *h, int flag, int bf, int ctx->unread--; if (!h->old) if (upd_ctx) - ctx->new--; + ctx->new --; } h->changed = true; if (upd_ctx) diff --git a/from.c b/from.c index 34be455d1..17c09bc4a 100644 --- a/from.c +++ b/from.c @@ -26,8 +26,8 @@ #include #include #include -#include "globals.h" #include "lib/lib.h" +#include "globals.h" #include "protos.h" /* diff --git a/group.c b/group.c index 19e0f37cc..e5e7f6f05 100644 --- a/group.c +++ b/group.c @@ -23,11 +23,11 @@ #include "config.h" #include +#include "lib/lib.h" #include "mutt.h" #include "group.h" #include "address.h" #include "globals.h" -#include "lib/lib.h" #include "list.h" #include "protos.h" #include "rfc822.h" @@ -165,7 +165,7 @@ int mutt_group_context_remove_adrlist(struct GroupContext *ctx, struct Address * } int mutt_group_context_add_regex(struct GroupContext *ctx, const char *s, - int flags, struct Buffer *err) + int flags, struct Buffer *err) { int rv = 0; diff --git a/handler.c b/handler.c index 55fc74d22..a4bbc7126 100644 --- a/handler.c +++ b/handler.c @@ -37,6 +37,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "body.h" #include "charset.h" @@ -44,7 +45,6 @@ #include "filter.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" @@ -1366,7 +1366,8 @@ static int multipart_handler(struct Body *a, struct State *s) NONULL(p->subtype)); } - if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) && (s->flags & MUTT_FIRSTDONE)) + if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) && + (s->flags & MUTT_FIRSTDONE)) break; } @@ -1492,7 +1493,7 @@ static int autoview_handler(struct Body *a, struct State *s) } } -bail: + bail: safe_fclose(&fpout); safe_fclose(&fperr); @@ -1937,7 +1938,8 @@ int mutt_body_handler(struct Body *b, struct State *s) /* only respect disposition == attachment if we're not displaying from the attachment menu (i.e. pager) */ - if ((!option(OPT_HONOR_DISPOSITION) || (b->disposition != DISPATTACH || option(OPT_VIEW_ATTACH))) && + if ((!option(OPT_HONOR_DISPOSITION) || + (b->disposition != DISPATTACH || option(OPT_VIEW_ATTACH))) && (plaintext || handler)) { rc = run_decode_and_handler(b, s, handler, plaintext); diff --git a/hcache/bdb.c b/hcache/bdb.c index 855421016..5518c0886 100644 --- a/hcache/bdb.c +++ b/hcache/bdb.c @@ -39,9 +39,9 @@ #include #include #include +#include "lib/lib.h" #include "backend.h" #include "globals.h" -#include "lib/lib.h" #include "mx.h" /** diff --git a/hcache/gdbm.c b/hcache/gdbm.c index cc5723145..34c81e773 100644 --- a/hcache/gdbm.c +++ b/hcache/gdbm.c @@ -33,9 +33,9 @@ #include "config.h" #include #include +#include "lib/lib.h" #include "backend.h" #include "globals.h" -#include "lib/lib.h" static void *hcache_gdbm_open(const char *path) { diff --git a/hcache/hcache.c b/hcache/hcache.c index 5f5795db6..4f20cd5ab 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -47,6 +47,7 @@ #include #include #include +#include "lib/lib.h" #include "address.h" #include "backend.h" #include "body.h" @@ -56,7 +57,6 @@ #include "hcache.h" #include "hcversion.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mbyte.h" #include "mutt_regex.h" @@ -320,7 +320,6 @@ static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off, } } - static unsigned char *dump_buffer(struct Buffer *b, unsigned char *d, int *off, int convert) { if (!b) diff --git a/hcache/kc.c b/hcache/kc.c index 466889abe..6a6e2116c 100644 --- a/hcache/kc.c +++ b/hcache/kc.c @@ -34,8 +34,8 @@ #include #include #include -#include "backend.h" #include "lib/lib.h" +#include "backend.h" #include "options.h" static void *hcache_kyotocabinet_open(const char *path) diff --git a/hcache/lmdb.c b/hcache/lmdb.c index abbf35408..f0aa0cd50 100644 --- a/hcache/lmdb.c +++ b/hcache/lmdb.c @@ -33,8 +33,8 @@ #include "config.h" #include #include -#include "backend.h" #include "lib/lib.h" +#include "backend.h" /** The maximum size of the database file (2GiB). * The file is mmap(2)'d into memory. */ diff --git a/hcache/qdbm.c b/hcache/qdbm.c index 0848970f2..7370915ae 100644 --- a/hcache/qdbm.c +++ b/hcache/qdbm.c @@ -34,8 +34,8 @@ #include #include #include -#include "backend.h" #include "lib/lib.h" +#include "backend.h" #include "options.h" static void *hcache_qdbm_open(const char *path) diff --git a/hcache/tc.c b/hcache/tc.c index 414c94fd4..350ab6781 100644 --- a/hcache/tc.c +++ b/hcache/tc.c @@ -34,8 +34,8 @@ #include #include #include -#include "backend.h" #include "lib/lib.h" +#include "backend.h" #include "options.h" static void *hcache_tokyocabinet_open(const char *path) diff --git a/hdrline.c b/hdrline.c index a864fcc1b..cfc2c2ebb 100644 --- a/hdrline.c +++ b/hdrline.c @@ -30,6 +30,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "body.h" @@ -38,7 +39,6 @@ #include "format_flags.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mbtable.h" #include "mutt_curses.h" #include "mutt_idna.h" @@ -1336,10 +1336,10 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co if (optional) mutt_expando_format(dest, destlen, col, cols, ifstring, hdr_format_str, - (unsigned long) hfi, flags); + (unsigned long) hfi, flags); else if (flags & MUTT_FORMAT_OPTIONAL) mutt_expando_format(dest, destlen, col, cols, elsestring, hdr_format_str, - (unsigned long) hfi, flags); + (unsigned long) hfi, flags); return src; #undef THREAD_NEW @@ -1355,8 +1355,8 @@ void _mutt_make_string(char *dest, size_t destlen, const char *s, hfi.ctx = ctx; hfi.pager_progress = 0; - mutt_expando_format(dest, destlen, 0, MuttIndexWindow->cols, s, hdr_format_str, - (unsigned long) &hfi, flags); + mutt_expando_format(dest, destlen, 0, MuttIndexWindow->cols, s, + hdr_format_str, (unsigned long) &hfi, flags); } void mutt_make_string_info(char *dst, size_t dstlen, int cols, const char *s, diff --git a/headers.c b/headers.c index 58faeaa8f..ab43b3824 100644 --- a/headers.c +++ b/headers.c @@ -28,6 +28,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "body.h" @@ -35,7 +36,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mutt_idna.h" #include "ncrypt/ncrypt.h" @@ -203,8 +203,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, } keep = false; } - else if ((WithCrypto & APPLICATION_PGP) && - (mutt_strncasecmp("pgp:", np->data, 4) == 0)) + else if ((WithCrypto & APPLICATION_PGP) && (mutt_strncasecmp("pgp:", np->data, 4) == 0)) { msg->security = mutt_parse_crypt_hdr(np->data + 4, 0, APPLICATION_PGP); if (msg->security) diff --git a/help.c b/help.c index 57626b4dd..7686e08ec 100644 --- a/help.c +++ b/help.c @@ -28,9 +28,9 @@ #include #include #include +#include "lib/lib.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "opcodes.h" @@ -42,7 +42,7 @@ static const char *HelpStrings[] = { #define DEFINE_HELP_MESSAGE(opcode, help_string) help_string, OPS(DEFINE_HELP_MESSAGE) #undef DEFINE_HELP_MESSAGE - NULL, + NULL, }; static const struct Binding *help_lookup_function(int op, int menu) diff --git a/history.c b/history.c index d5d344f03..a06be53fe 100644 --- a/history.c +++ b/history.c @@ -26,10 +26,10 @@ #include #include #include +#include "lib/lib.h" #include "history.h" #include "charset.h" #include "globals.h" -#include "lib/lib.h" #include "protos.h" /* This history ring grows from 0..History, with last marking the @@ -216,7 +216,8 @@ static void shrink_histfile(void) if (hclass >= HC_LAST) continue; *p = '\0'; - if (option(OPT_HISTORY_REMOVE_DUPS) && (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1)) + if (option(OPT_HISTORY_REMOVE_DUPS) && + (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1)) { regen_file = true; continue; diff --git a/hook.c b/hook.c index 75937bd5a..a9a4b1363 100644 --- a/hook.c +++ b/hook.c @@ -28,16 +28,15 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "context.h" #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" -#include "mutt.h" #include "mutt_regex.h" #include "ncrypt/ncrypt.h" #include "options.h" @@ -403,7 +402,8 @@ void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type) continue; if (hook->type & type) - if ((mutt_pattern_exec(hook->pattern, 0, ctx, hdr, &cache) > 0) ^ hook->regex.not) + if ((mutt_pattern_exec(hook->pattern, 0, ctx, hdr, &cache) > 0) ^ + hook->regex.not) { if (mutt_parse_rc_line(hook->command, &token, &err) == -1) { @@ -440,7 +440,8 @@ static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx, continue; if (hook->type & type) - if ((mutt_pattern_exec(hook->pattern, 0, ctx, hdr, &cache) > 0) ^ hook->regex.not) + if ((mutt_pattern_exec(hook->pattern, 0, ctx, hdr, &cache) > 0) ^ + hook->regex.not) { mutt_make_string(path, pathlen, hook->command, ctx, hdr); return 0; @@ -506,8 +507,8 @@ static char *_mutt_string_hook(const char *match, int hook) TAILQ_FOREACH(tmp, &Hooks, entries) { - if ((tmp->type & hook) && - ((match && regexec(tmp->regex.regex, match, 0, NULL, 0) == 0) ^ tmp->regex.not)) + if ((tmp->type & hook) && ((match && regexec(tmp->regex.regex, match, 0, NULL, 0) == 0) ^ + tmp->regex.not)) return tmp->command; } return NULL; @@ -519,8 +520,8 @@ static void _mutt_list_hook(struct ListHead *matches, const char *match, int hoo TAILQ_FOREACH(tmp, &Hooks, entries) { - if ((tmp->type & hook) && - ((match && regexec(tmp->regex.regex, match, 0, NULL, 0) == 0) ^ tmp->regex.not)) + if ((tmp->type & hook) && ((match && regexec(tmp->regex.regex, match, 0, NULL, 0) == 0) ^ + tmp->regex.not)) mutt_list_insert_tail(matches, safe_strdup(tmp->command)); } } diff --git a/imap/auth.c b/imap/auth.c index 515750326..bd1bc99d7 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -26,9 +26,9 @@ #include "config.h" #include +#include "lib/lib.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "protos.h" static const struct ImapAuth imap_authenticators[] = { diff --git a/imap/auth_anon.c b/imap/auth_anon.c index 527964b10..2645037e9 100644 --- a/imap/auth_anon.c +++ b/imap/auth_anon.c @@ -24,10 +24,10 @@ #include "config.h" #include "imap_private.h" +#include "lib/lib.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "protos.h" diff --git a/imap/auth_cram.c b/imap/auth_cram.c index 61142e9da..df322287e 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -26,10 +26,10 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "protos.h" diff --git a/imap/auth_gss.c b/imap/auth_gss.c index 8191d9d0b..3a9866d07 100644 --- a/imap/auth_gss.c +++ b/imap/auth_gss.c @@ -27,14 +27,14 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" +#include "mutt.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "protos.h" -#include "mutt.h" #ifdef HAVE_HEIMDAL #include #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE diff --git a/imap/auth_login.c b/imap/auth_login.c index 8ae9014cb..9627d94e2 100644 --- a/imap/auth_login.c +++ b/imap/auth_login.c @@ -25,14 +25,14 @@ #include "config.h" #include #include "imap_private.h" +#include "lib/lib.h" +#include "mutt.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "protos.h" -#include "mutt.h" /** * imap_auth_login - Plain LOGIN support diff --git a/imap/auth_plain.c b/imap/auth_plain.c index 4bd13eff5..4e218540e 100644 --- a/imap/auth_plain.c +++ b/imap/auth_plain.c @@ -25,10 +25,10 @@ #include "config.h" #include "imap_private.h" +#include "lib/lib.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_sasl_plain.h" #include "mutt_socket.h" #include "protos.h" diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 16856ffe8..fe922de5d 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -29,10 +29,10 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "account.h" #include "auth.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_sasl.h" #include "mutt_socket.h" #include "options.h" diff --git a/imap/browse.c b/imap/browse.c index a86c58c84..06783a542 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -32,6 +32,7 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "browser.h" @@ -39,7 +40,6 @@ #include "context.h" #include "globals.h" #include "imap/imap.h" -#include "lib/lib.h" #include "mutt_regex.h" #include "options.h" #include "protos.h" diff --git a/imap/command.c b/imap/command.c index 1364a0bcf..97720c9a3 100644 --- a/imap/command.c +++ b/imap/command.c @@ -33,13 +33,13 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "account.h" #include "buffy.h" #include "context.h" #include "globals.h" #include "header.h" #include "imap/imap.h" -#include "lib/lib.h" #include "mailbox.h" #include "message.h" #include "mutt_menu.h" diff --git a/imap/imap.c b/imap/imap.c index ceecbc8a5..22bd9586d 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -34,6 +34,7 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "mutt.h" #include "imap.h" #include "account.h" @@ -45,7 +46,6 @@ #include "globals.h" #include "header.h" #include "imap/imap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "message.h" @@ -1760,7 +1760,7 @@ struct ImapStatus *imap_mboxcache_get(struct ImapData *idata, const char *mbox, { struct ImapStatus *scache = safe_calloc(1, sizeof(struct ImapStatus)); scache->name = (char *) mbox; - mutt_list_insert_tail(&idata->mboxcache, (char *)scache); + mutt_list_insert_tail(&idata->mboxcache, (char *) scache); status = imap_mboxcache_get(idata, mbox, 0); status->name = safe_strdup(mbox); } @@ -2150,7 +2150,8 @@ int imap_complete(char *dest, size_t dlen, char *path) list[0] = '\0'; /* fire off command */ - snprintf(buf, sizeof(buf), "%s \"\" \"%s%%\"", option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST", list); + snprintf(buf, sizeof(buf), "%s \"\" \"%s%%\"", + option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST", list); imap_cmd_start(idata, buf); diff --git a/imap/message.c b/imap/message.c index c84086cfa..a4e3e5fef 100644 --- a/imap/message.c +++ b/imap/message.c @@ -31,6 +31,7 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "mutt.h" #include "message.h" #include "account.h" @@ -41,7 +42,6 @@ #include "globals.h" #include "header.h" #include "imap/imap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mutt_curses.h" @@ -53,11 +53,11 @@ #include "hcache/hcache.h" #endif -static struct ImapHeaderData* imap_new_header_data(void) +static struct ImapHeaderData *imap_new_header_data(void) { - struct ImapHeaderData *d = safe_calloc(1, sizeof(struct ImapHeaderData)); - STAILQ_INIT(&d->keywords); - return d; + struct ImapHeaderData *d = safe_calloc(1, sizeof(struct ImapHeaderData)); + STAILQ_INIT(&d->keywords); + return d; } static void imap_update_context(struct ImapData *idata, int oldmsgcount) diff --git a/imap/utf7.c b/imap/utf7.c index 05cc264a6..b86ea16aa 100644 --- a/imap/utf7.c +++ b/imap/utf7.c @@ -23,9 +23,9 @@ #include "config.h" #include #include "imap_private.h" +#include "lib/lib.h" #include "charset.h" #include "globals.h" -#include "lib/lib.h" // clang-format off /* This is very similar to the table in lib/lib_base64.c diff --git a/imap/util.c b/imap/util.c index 299cc496d..2e8614911 100644 --- a/imap/util.c +++ b/imap/util.c @@ -37,6 +37,7 @@ #include #include #include "imap_private.h" +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "bcache.h" @@ -44,7 +45,6 @@ #include "globals.h" #include "header.h" #include "imap/imap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "message.h" @@ -404,8 +404,7 @@ int imap_mxcmp(const char *mx1, const char *mx2) mx1 = "INBOX"; if (!mx2 || !*mx2) mx2 = "INBOX"; - if ((mutt_strcasecmp(mx1, "INBOX") == 0) && - (mutt_strcasecmp(mx2, "INBOX") == 0)) + if ((mutt_strcasecmp(mx1, "INBOX") == 0) && (mutt_strcasecmp(mx2, "INBOX") == 0)) return 0; b1 = safe_malloc(strlen(mx1) + 1); diff --git a/init.c b/init.c index 11da787e6..78b434331 100644 --- a/init.c +++ b/init.c @@ -37,6 +37,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "init.h" #include "address.h" @@ -50,12 +51,10 @@ #include "header.h" #include "history.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" -#include "mbyte.h" #include "mbtable.h" -#include "mutt.h" +#include "mbyte.h" #include "mutt_curses.h" #include "mutt_idna.h" #include "mutt_menu.h" @@ -317,9 +316,8 @@ static struct MbTable *parse_mbtable(const char *s) { if (k == (size_t)(-1) || k == (size_t)(-2)) { - mutt_debug( - 1, "parse_mbtable: mbrtowc returned %d converting %s in %s\n", - (k == (size_t)(-1)) ? -1 : -2, s, t->orig_str); + mutt_debug(1, "parse_mbtable: mbrtowc returned %d converting %s in %s\n", + (k == (size_t)(-1)) ? -1 : -2, s, t->orig_str); if (k == (size_t)(-1)) memset(&mbstate, 0, sizeof(mbstate)); k = (k == (size_t)(-1)) ? 1 : slen; @@ -770,7 +768,8 @@ static struct RegexList *new_regex_list(void) return safe_calloc(1, sizeof(struct RegexList)); } -int mutt_add_to_regex_list(struct RegexList **list, const char *s, int flags, struct Buffer *err) +int mutt_add_to_regex_list(struct RegexList **list, const char *s, int flags, + struct Buffer *err) { struct RegexList *t = NULL, *last = NULL; struct Regex *rx = NULL; @@ -1109,21 +1108,20 @@ static int parse_ignore(struct Buffer *buf, struct Buffer *s, return 0; } -static int parse_stailq(struct Buffer *buf, struct Buffer *s, unsigned long data, - struct Buffer *err) +static int parse_stailq(struct Buffer *buf, struct Buffer *s, + unsigned long data, struct Buffer *err) { - do { mutt_extract_token(buf, s, 0); - add_to_stailq((struct ListHead *)data, buf->data); + add_to_stailq((struct ListHead *) data, buf->data); } while (MoreArgs(s)); return 0; } static int parse_unstailq(struct Buffer *buf, struct Buffer *s, - unsigned long data, struct Buffer *err) + unsigned long data, struct Buffer *err) { do { @@ -1133,10 +1131,10 @@ static int parse_unstailq(struct Buffer *buf, struct Buffer *s, */ if (mutt_strcmp(buf->data, "*") == 0) { - mutt_list_free((struct ListHead *)data); + mutt_list_free((struct ListHead *) data); break; } - remove_from_stailq((struct ListHead *)data, buf->data); + remove_from_stailq((struct ListHead *) data, buf->data); } while (MoreArgs(s)); return 0; @@ -1486,7 +1484,8 @@ static int parse_group(struct Buffer *buf, struct Buffer *s, unsigned long data, if (data == MUTT_GROUP && mutt_group_context_add_regex(gc, buf->data, REG_ICASE, err) != 0) goto bail; - else if (data == MUTT_UNGROUP && mutt_group_context_remove_regex(gc, buf->data) < 0) + else if (data == MUTT_UNGROUP && + mutt_group_context_remove_regex(gc, buf->data) < 0) goto bail; break; @@ -1592,7 +1591,7 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, mutt_debug(5, "parse_attach_list: added %s/%s [%d]\n", a->major, a->minor, a->major_int); - mutt_list_insert_tail(head, (char *)a); + mutt_list_insert_tail(head, (char *) a); } while (MoreArgs(s)); _attachments_clean(); @@ -4089,7 +4088,8 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) Groups = hash_create(1031, 0); /* reverse alias keys need to be strdup'ed because of idna conversions */ - ReverseAliases = hash_create(1031, MUTT_HASH_STRCASECMP | MUTT_HASH_STRDUP_KEYS | MUTT_HASH_ALLOW_DUPS); + ReverseAliases = + hash_create(1031, MUTT_HASH_STRCASECMP | MUTT_HASH_STRDUP_KEYS | MUTT_HASH_ALLOW_DUPS); #ifdef USE_NOTMUCH TagTransforms = hash_create(64, 1); TagFormats = hash_create(64, 0); diff --git a/init.h b/init.h index 34ee1dc56..eb683f7be 100644 --- a/init.h +++ b/init.h @@ -1125,7 +1125,7 @@ struct Option MuttVars[] = { ** caching will be used. ** .pp ** Header caching can greatly improve speed when opening POP, IMAP - ** MH or Folder folders, see ``$caching'' for details. + ** MH or Maildir folders, see ``$caching'' for details. */ { "header_cache_backend", DT_HCACHE, R_NONE, UL &HeaderCacheBackend, UL 0 }, /* @@ -1742,7 +1742,7 @@ struct Option MuttVars[] = { { "mark_macro_prefix",DT_STRING, R_NONE, UL &MarkMacroPrefix, UL "'" }, /* ** .pp - ** IndentString for macros created using mark-message. A new macro + ** Prefix for macros created using mark-message. A new macro ** automatically generated with \fIa\fP will be composed ** from this prefix and the letter \fIa\fP. */ @@ -1782,7 +1782,7 @@ struct Option MuttVars[] = { /* ** .pp ** The default mailbox type used when creating new folders. May be any of - ** ``mbox'', ``MMDF'', ``MH'' and ``Folder''. This is overridden by the + ** ``mbox'', ``MMDF'', ``MH'' and ``Maildir''. This is overridden by the ** \fC-m\fP command-line option. */ { "menu_context", DT_NUMBER, R_NONE, UL &MenuContext, 0 }, diff --git a/keymap.c b/keymap.c index ac272f0e7..6e47a011d 100644 --- a/keymap.c +++ b/keymap.c @@ -27,11 +27,11 @@ #include #include #include +#include "lib/lib.h" +#include "mutt.h" #include "keymap.h" #include "functions.h" #include "globals.h" -#include "lib/lib.h" -#include "mutt.h" #include "mutt_curses.h" #include "ncrypt/ncrypt.h" #include "opcodes.h" @@ -509,7 +509,7 @@ int km_dokey(int menu) timeout(-1); #ifdef USE_IMAP -gotkey: + gotkey: #endif /* hide timeouts, but not window resizes, from the line editor. */ if (menu == MENU_EDITOR && tmp.ch == -2 && !SigWinch) diff --git a/lib/mapping.c b/lib/mapping.c index c9fecee4e..94cea01a6 100644 --- a/lib/mapping.c +++ b/lib/mapping.c @@ -32,8 +32,8 @@ * | mutt_getvaluebyname() | Lookup the constant for a string */ -#include "string2.h" #include "mapping.h" +#include "string2.h" /** * mutt_getnamebyvalue - Lookup a string for a constant @@ -64,4 +64,3 @@ int mutt_getvaluebyname(const char *name, const struct Mapping *map) return map[i].value; return -1; } - diff --git a/main.c b/main.c index 4b81462f7..5610c6cd4 100644 --- a/main.c +++ b/main.c @@ -37,6 +37,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -46,7 +47,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mutt_curses.h" @@ -559,7 +559,7 @@ int main(int argc, char **argv, char **env) mutt_endwin(NULL); } else if (subject || msg || sendflags || draftFile || includeFile || - !STAILQ_EMPTY(&attach) || optind < argc) + !STAILQ_EMPTY(&attach) || optind < argc) { FILE *fin = NULL; FILE *fout = NULL; diff --git a/mbox.c b/mbox.c index 4c6d8148e..beaf128ec 100644 --- a/mbox.c +++ b/mbox.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "body.h" @@ -41,7 +42,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mutt_curses.h" @@ -1003,7 +1003,8 @@ void mbox_reset_atime(struct Context *ctx, struct stat *st) * When $mbox_check_recent is set, existing new mail is ignored, so do not * reset the atime to mtime-1 to signal new mail. */ - if (!option(OPT_MAIL_CHECK_RECENT) && utimebuf.actime >= utimebuf.modtime && mbox_has_new(ctx)) + if (!option(OPT_MAIL_CHECK_RECENT) && utimebuf.actime >= utimebuf.modtime && + mbox_has_new(ctx)) utimebuf.actime = utimebuf.modtime - 1; utime(ctx->path, &utimebuf); diff --git a/mbyte.c b/mbyte.c index 5b427ff14..f3ef3d7b2 100644 --- a/mbyte.c +++ b/mbyte.c @@ -30,9 +30,9 @@ #include #include #include +#include "lib/lib.h" #include "mbyte.h" #include "charset.h" -#include "lib/lib.h" #include "options.h" #include "protos.h" diff --git a/menu.c b/menu.c index a9324c116..9569d4628 100644 --- a/menu.c +++ b/menu.c @@ -30,11 +30,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "context.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "mbyte.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -432,7 +432,7 @@ void menu_redraw_motion(struct Menu *menu) print_enriched_string(menu->oldcurrent, old_color, (unsigned char *) buf, 1); /* now draw the new one to reflect the change */ - cur_color = menu->color (menu->current); + cur_color = menu->color(menu->current); menu_make_entry(buf, sizeof(buf), menu, menu->current); menu_pad_string(menu, buf, sizeof(buf)); SETCOLOR(MT_COLOR_INDICATOR); diff --git a/mh.c b/mh.c index 1b63da614..5b384d00e 100644 --- a/mh.c +++ b/mh.c @@ -43,6 +43,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "body.h" #include "buffy.h" @@ -51,7 +52,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" #include "mutt_curses.h" #include "mx.h" @@ -1513,8 +1513,8 @@ static int maildir_open_new_message(struct Message *msg, struct Context *dest, omask = umask(mh_umask(dest)); while (true) { - snprintf(path, _POSIX_PATH_MAX, "%s/tmp/%s.%lld.R%" PRIu64 ".%s%s", dest->path, - subdir, (long long) time(NULL), mutt_rand64(), NONULL(ShortHostname), suffix); + snprintf(path, _POSIX_PATH_MAX, "%s/tmp/%s.%lld.R%" PRIu64 ".%s%s", dest->path, subdir, + (long long) time(NULL), mutt_rand64(), NONULL(ShortHostname), suffix); mutt_debug(2, "maildir_open_new_message (): Trying %s.\n", path); diff --git a/mutt_idna.c b/mutt_idna.c index 0a80fedd4..2923444f7 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -24,12 +24,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt_idna.h" #include "address.h" #include "charset.h" #include "envelope.h" #include "globals.h" -#include "lib/lib.h" #include "options.h" #ifdef HAVE_LIBIDN diff --git a/mutt_lua.c b/mutt_lua.c index 7c7d6166d..fcd8b5be8 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -29,10 +29,10 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "mutt_lua.h" #include "globals.h" -#include "lib/lib.h" #include "mailbox.h" #include "mbtable.h" #include "mutt_commands.h" diff --git a/mutt_notmuch.c b/mutt_notmuch.c index a72bd72d3..0e3ee7028 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -46,6 +46,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "mutt_notmuch.h" #include "body.h" @@ -54,7 +55,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" #include "mutt_curses.h" #include "mx.h" @@ -556,8 +556,7 @@ static bool windowed_query_from_query(const char *query, char *buf, size_t bufsz } /* if the query has changed, reset the window position */ - if (NmQueryWindowCurrentSearch == NULL || - (strcmp(query, NmQueryWindowCurrentSearch) != 0)) + if (NmQueryWindowCurrentSearch == NULL || (strcmp(query, NmQueryWindowCurrentSearch) != 0)) query_window_reset(); if (!query_window_check_timebase(NmQueryWindowTimebase)) @@ -569,8 +568,8 @@ static bool windowed_query_from_query(const char *query, char *buf, size_t bufsz } if (end == 0) - snprintf(buf, bufsz, "date:%d%s..now and %s", beg, - NmQueryWindowTimebase, NmQueryWindowCurrentSearch); + snprintf(buf, bufsz, "date:%d%s..now and %s", beg, NmQueryWindowTimebase, + NmQueryWindowCurrentSearch); else snprintf(buf, bufsz, "date:%d%s..%d%s and %s", beg, NmQueryWindowTimebase, end, NmQueryWindowTimebase, NmQueryWindowCurrentSearch); diff --git a/mutt_sasl.c b/mutt_sasl.c index 775086981..c7e22e472 100644 --- a/mutt_sasl.c +++ b/mutt_sasl.c @@ -29,9 +29,9 @@ #include #include #include +#include "lib/lib.h" #include "mutt_sasl.h" #include "account.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "protos.h" diff --git a/mutt_sasl_plain.c b/mutt_sasl_plain.c index 011a15bb6..d3c71d6a5 100644 --- a/mutt_sasl_plain.c +++ b/mutt_sasl_plain.c @@ -22,8 +22,8 @@ #include "config.h" #include -#include "mutt_sasl_plain.h" #include "lib/lib.h" +#include "mutt_sasl_plain.h" #include "protos.h" size_t mutt_sasl_plain_msg(char *buf, size_t buflen, const char *cmd, diff --git a/mutt_ssl.c b/mutt_ssl.c index 7a7215393..db10fb402 100644 --- a/mutt_ssl.c +++ b/mutt_ssl.c @@ -41,12 +41,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "mutt_ssl.h" #include "account.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "mutt_idna.h" #include "mutt_menu.h" #include "mutt_socket.h" @@ -855,7 +855,8 @@ static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int al * true, then check_certificate_file() must be false. Therefore we don't need * to also scan the certificate file here. */ - allow_always = allow_always && CertificateFile && check_certificate_expiration(cert, true); + allow_always = + allow_always && CertificateFile && check_certificate_expiration(cert, true); /* L10N: * These four letters correspond to the choices in the next four strings: diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index 8c3293ab7..2076fbb40 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -30,11 +30,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "globals.h" #include "keymap.h" -#include "lib/lib.h" #include "mutt_menu.h" #include "mutt_regex.h" #include "mutt_socket.h" @@ -1045,7 +1045,8 @@ static int tls_negotiate(struct Connection *conn) if (SslCaCertificatesFile) { - gnutls_certificate_set_x509_trust_file(data->xcred, SslCaCertificatesFile, GNUTLS_X509_FMT_PEM); + gnutls_certificate_set_x509_trust_file(data->xcred, SslCaCertificatesFile, + GNUTLS_X509_FMT_PEM); } if (SslClientCert) diff --git a/mutt_tunnel.c b/mutt_tunnel.c index 99d49e977..e7994072d 100644 --- a/mutt_tunnel.c +++ b/mutt_tunnel.c @@ -30,11 +30,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "mutt_tunnel.h" #include "account.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "protos.h" diff --git a/muttlib.c b/muttlib.c index 1f3e42804..f18620845 100644 --- a/muttlib.c +++ b/muttlib.c @@ -44,6 +44,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -54,11 +55,9 @@ #include "format_flags.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" -#include "mutt.h" #include "mutt_curses.h" #include "mutt_regex.h" #include "mx.h" @@ -247,8 +246,8 @@ char *_mutt_expand_path(char *s, size_t slen, int regex) { #ifdef USE_IMAP /* if folder = {host} or imap[s]://host/: don't append slash */ - if (mx_is_imap(NONULL(Folder)) && (Folder[strlen(Folder) - 1] == '}' || - Folder[strlen(Folder) - 1] == '/')) + if (mx_is_imap(NONULL(Folder)) && + (Folder[strlen(Folder) - 1] == '}' || Folder[strlen(Folder) - 1] == '/')) strfcpy(p, NONULL(Folder), sizeof(p)); else #endif @@ -531,8 +530,8 @@ void _mutt_mktemp(char *s, size_t slen, const char *prefix, const char *suffix, const char *src, int line) { size_t n = snprintf(s, slen, "%s/%s-%s-%d-%d-%" PRIu64 "%s%s", NONULL(Tmpdir), - NONULL(prefix), NONULL(ShortHostname), (int) getuid(), (int) getpid(), - mutt_rand64(), suffix ? "." : "", NONULL(suffix)); + 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", @@ -992,8 +991,8 @@ void mutt_expando_format(char *dest, size_t destlen, size_t col, int cols, mutt_extract_token(word, srcbuf, 0); mutt_debug(3, "fmtpipe %2d: %s\n", i++, word->data); mutt_buffer_addch(command, '\''); - mutt_expando_format(buf, sizeof(buf), 0, cols, word->data, callback, data, - flags | MUTT_FORMAT_NOFILTER); + mutt_expando_format(buf, sizeof(buf), 0, cols, word->data, callback, + data, flags | MUTT_FORMAT_NOFILTER); for (p = buf; p && *p; p++) { if (*p == '\'') @@ -1049,7 +1048,7 @@ void mutt_expando_format(char *dest, size_t destlen, size_t col, int cols, * format pipes does not try to append a nul itself. */ mutt_expando_format(dest, destlen + 1, col, cols, recycler, - callback, data, flags); + callback, data, flags); FREE(&recycler); } } @@ -1994,4 +1993,3 @@ int mutt_inbox_cmp(const char *a, const char *b) return 0; } - diff --git a/mx.c b/mx.c index 675a48094..285d86f26 100644 --- a/mx.c +++ b/mx.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "mx.h" #include "address.h" @@ -43,7 +44,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mailbox.h" #include "ncrypt/ncrypt.h" #include "opcodes.h" @@ -662,7 +662,8 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) if (nntp_data && nntp_data->nserv && nntp_data->group) { - int rc = query_quadoption(OPT_CATCHUP_NEWSGROUP, _("Mark all articles read?")); + int rc = + query_quadoption(OPT_CATCHUP_NEWSGROUP, _("Mark all articles read?")); if (rc == MUTT_ABORT) { ctx->closing = false; @@ -945,7 +946,7 @@ void mx_update_tables(struct Context *ctx, int committing) { ctx->unread++; if (!ctx->hdrs[j]->old) - ctx->new++; + ctx->new ++; } j++; @@ -1337,7 +1338,7 @@ void mx_update_context(struct Context *ctx, int new_messages) { ctx->unread++; if (!h->old) - ctx->new++; + ctx->new ++; } } } diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 1d7f35590..252706db5 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -43,7 +44,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mime.h" #include "mutt_curses.h" #include "ncrypt.h" @@ -160,13 +160,15 @@ int mutt_protect(struct Header *msg, char *keylist) return -1; } } - else if (!mutt_strcasecmp ("flowed", - mutt_get_parameter ("format", msg->content->parameter))) + else if (!mutt_strcasecmp("flowed", + mutt_get_parameter("format", msg->content->parameter))) { - if ((query_quadoption (OPT_PGP_MIME_AUTO, - _("Inline PGP can't be used with format=flowed. Revert to PGP/MIME?"))) != MUTT_YES) + if ((query_quadoption(OPT_PGP_MIME_AUTO, + _("Inline PGP can't be used with format=flowed. " + "Revert to PGP/MIME?"))) != MUTT_YES) { - mutt_error(_("Mail not sent: inline PGP can't be used with format=flowed.")); + mutt_error( + _("Mail not sent: inline PGP can't be used with format=flowed.")); return -1; } } diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 1f3719a57..a60418a73 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -45,6 +45,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -56,7 +57,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" @@ -901,8 +901,8 @@ static char *encrypt_gpgme_object(gpgme_data_t plaintext, gpgme_key_t *rset, static void strlower(char *s) { - for (; *s; ++s) - *s = tolower(*s); + for (; *s; ++s) + *s = tolower(*s); } /** @@ -3091,7 +3091,7 @@ static void crypt_entry(char *s, size_t l, struct Menu *menu, int num) entry.num = num + 1; mutt_expando_format(s, l, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat), - crypt_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); + crypt_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); } /** @@ -4232,8 +4232,9 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, } } - if (option(OPT_PGP_CHECK_TRUST) && (!crypt_id_is_valid(key_table[menu->current]) || - !crypt_id_is_strong(key_table[menu->current]))) + if (option(OPT_PGP_CHECK_TRUST) && + (!crypt_id_is_valid(key_table[menu->current]) || + !crypt_id_is_strong(key_table[menu->current]))) { const char *warn_s = NULL; char buff[LONG_STRING]; @@ -4325,7 +4326,7 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a, return NULL; mutt_debug(5, "crypt_getkeybyaddr: looking for %s <%s>.\n", - a ? a->personal : "", a ? a->mailbox : ""); + a ? a->personal : "", a ? a->mailbox : ""); for (k = keys; k; k = k->next) { diff --git a/ncrypt/crypt_mod.c b/ncrypt/crypt_mod.c index 45e74f2bf..b62cdec7b 100644 --- a/ncrypt/crypt_mod.c +++ b/ncrypt/crypt_mod.c @@ -21,8 +21,8 @@ */ #include "config.h" -#include "crypt_mod.h" #include "lib/lib.h" +#include "crypt_mod.h" /** * struct CryptModule - A crypto plugin module diff --git a/ncrypt/cryptglue.c b/ncrypt/cryptglue.c index 138108707..fa729d874 100644 --- a/ncrypt/cryptglue.c +++ b/ncrypt/cryptglue.c @@ -34,9 +34,9 @@ #include "config.h" #include +#include "lib/lib.h" #include "crypt_mod.h" #include "globals.h" -#include "lib/lib.h" #include "ncrypt.h" #include "options.h" #include "protos.h" diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 8ba3a2086..f5daa70db 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -38,11 +38,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "charset.h" #include "filter.h" #include "globals.h" -#include "lib/lib.h" #include "mime.h" #include "ncrypt.h" #include "options.h" diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index fa2d6948c..285e5dac8 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -43,8 +43,8 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "pgp.h" #include "address.h" #include "body.h" #include "charset.h" @@ -53,7 +53,6 @@ #include "filter.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" @@ -61,6 +60,7 @@ #include "ncrypt.h" #include "options.h" #include "parameter.h" +#include "pgp.h" #include "pgpinvoke.h" #include "pgplib.h" #include "pgpmicalg.h" diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 0cdb02dd7..f03bb3349 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -30,11 +30,11 @@ #include #include #include +#include "lib/lib.h" #include "address.h" #include "filter.h" #include "format_flags.h" #include "globals.h" -#include "lib/lib.h" #include "list.h" #include "mutt_curses.h" #include "mutt_idna.h" @@ -139,7 +139,8 @@ static const char *_mutt_fmt_pgp_command(char *dest, size_t destlen, size_t col, if (optional) mutt_expando_format(dest, destlen, col, cols, ifstring, _mutt_fmt_pgp_command, data, 0); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(dest, destlen, col, cols, elsestring, _mutt_fmt_pgp_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, elsestring, + _mutt_fmt_pgp_command, data, 0); return src; } @@ -148,7 +149,7 @@ static void mutt_pgp_command(char *d, size_t dlen, struct PgpCommandContext *cctx, const char *fmt) { mutt_expando_format(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), - _mutt_fmt_pgp_command, (unsigned long) cctx, 0); + _mutt_fmt_pgp_command, (unsigned long) cctx, 0); mutt_debug(2, "mutt_pgp_command: %s\n", d); } @@ -315,7 +316,7 @@ pid_t pgp_invoke_verify_key(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpi pid_t pgp_invoke_list_keys(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, - enum PgpRing keyring, struct ListHead *hints) + enum PgpRing keyring, struct ListHead *hints) { char uids[HUGE_STRING]; char tmpuids[HUGE_STRING]; diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 83fff289e..c44795ced 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "pgpkey.h" #include "address.h" @@ -42,7 +43,6 @@ #include "globals.h" #include "gnupgparse.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mime.h" #include "mutt_curses.h" @@ -305,7 +305,7 @@ static void pgp_entry(char *s, size_t l, struct Menu *menu, int num) entry.num = num + 1; mutt_expando_format(s, l, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat), - pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); + pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); } static int _pgp_compare_address(const void *a, const void *b) @@ -610,7 +610,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, } if (option(OPT_PGP_CHECK_TRUST) && (!pgp_id_is_valid(KeyTable[menu->current]) || - !pgp_id_is_strong(KeyTable[menu->current]))) + !pgp_id_is_strong(KeyTable[menu->current]))) { char *str = ""; char buff[LONG_STRING]; diff --git a/ncrypt/pgplib.c b/ncrypt/pgplib.c index d6e23c53f..54f191dd3 100644 --- a/ncrypt/pgplib.c +++ b/ncrypt/pgplib.c @@ -24,8 +24,8 @@ #include "config.h" #include -#include "pgplib.h" #include "lib/lib.h" +#include "pgplib.h" const char *pgp_pkalgbytype(unsigned char type) { diff --git a/ncrypt/pgpmicalg.c b/ncrypt/pgpmicalg.c index 33ed5bc1a..b10edfbd8 100644 --- a/ncrypt/pgpmicalg.c +++ b/ncrypt/pgpmicalg.c @@ -31,8 +31,8 @@ #include #include #include -#include "mutt.h" #include "lib/lib.h" +#include "mutt.h" #include "pgppacket.h" #include "protos.h" #include "state.h" diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 4f533ae11..f25aff8f8 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -32,8 +32,8 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "smime.h" #include "address.h" #include "alias.h" #include "body.h" @@ -46,7 +46,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mime.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -56,6 +55,7 @@ #include "parameter.h" #include "protos.h" #include "rfc822.h" +#include "smime.h" #include "state.h" /** @@ -286,10 +286,11 @@ static const char *_mutt_fmt_smime_command(char *dest, size_t destlen, size_t co } if (optional) - mutt_expando_format(dest, destlen, col, cols, ifstring, _mutt_fmt_smime_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, ifstring, + _mutt_fmt_smime_command, data, 0); else if (flags & MUTT_FORMAT_OPTIONAL) mutt_expando_format(dest, destlen, col, cols, elsestring, - _mutt_fmt_smime_command, data, 0); + _mutt_fmt_smime_command, data, 0); return src; } @@ -298,7 +299,7 @@ static void smime_command(char *d, size_t dlen, struct SmimeCommandContext *cctx, const char *fmt) { mutt_expando_format(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), - _mutt_fmt_smime_command, (unsigned long) cctx, 0); + _mutt_fmt_smime_command, (unsigned long) cctx, 0); mutt_debug(2, "smime_command: %s\n", d); } @@ -1293,15 +1294,15 @@ static pid_t smime_invoke_encrypt(FILE **smimein, FILE **smimeout, FILE **smimee const char *fname, const char *uids) { return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, - smimeerrfd, fname, NULL, SmimeEncryptWith, NULL, NULL, uids, - NULL, SmimeEncryptCommand); + smimeerrfd, fname, NULL, SmimeEncryptWith, NULL, NULL, + uids, NULL, SmimeEncryptCommand); } static pid_t smime_invoke_sign(FILE **smimein, FILE **smimeout, FILE **smimeerr, int smimeinfd, int smimeoutfd, int smimeerrfd, const char *fname) { - return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, - smimeerrfd, fname, NULL, NULL, SmimeSignDigestAlg, SmimeKeyToUse, + return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, smimeerrfd, + fname, NULL, NULL, SmimeSignDigestAlg, SmimeKeyToUse, SmimeCertToUse, SmimeIntermediateToUse, SmimeSignCommand); } diff --git a/newsrc.c b/newsrc.c index 489fb561b..4874cbe08 100644 --- a/newsrc.c +++ b/newsrc.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "bcache.h" @@ -39,7 +40,6 @@ #include "format_flags.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_socket.h" #include "mx.h" @@ -1029,7 +1029,7 @@ struct NntpServer *nntp_select_server(char *server, int leave_lock) if (rc >= 0) { mutt_expando_format(file, sizeof(file), 0, MuttIndexWindow->cols, - NONULL(NewsRc), nntp_format_str, (unsigned long) nserv, 0); + NONULL(NewsRc), nntp_format_str, (unsigned long) nserv, 0); mutt_expand_path(file, sizeof(file)); nserv->newsrc_file = safe_strdup(file); rc = nntp_newsrc_parse(nserv); diff --git a/nntp.c b/nntp.c index 06a79bc4a..91cf9d796 100644 --- a/nntp.c +++ b/nntp.c @@ -27,6 +27,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "nntp.h" #include "account.h" @@ -36,7 +37,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" #include "mutt_curses.h" #include "mutt_socket.h" @@ -1453,8 +1453,7 @@ static int nntp_open_mailbox(struct Context *ctx) struct Url url; strfcpy(buf, ctx->path, sizeof(buf)); - if (url_parse(&url, buf) < 0 || !url.path || - !(url.scheme == U_NNTP || url.scheme == U_NNTPS)) + if (url_parse(&url, buf) < 0 || !url.path || !(url.scheme == U_NNTP || url.scheme == U_NNTPS)) { mutt_error(_("%s is an invalid newsgroup specification!"), ctx->path); mutt_sleep(2); @@ -1540,8 +1539,8 @@ static int nntp_open_mailbox(struct Context *ctx) time(&nserv->check_time); ctx->data = nntp_data; - if (!nntp_data->bcache && - (nntp_data->newsrc_ent || nntp_data->subscribed || option(OPT_SAVE_UNSUBSCRIBED))) + if (!nntp_data->bcache && (nntp_data->newsrc_ent || nntp_data->subscribed || + option(OPT_SAVE_UNSUBSCRIBED))) nntp_data->bcache = mutt_bcache_open(&nserv->conn->account, nntp_data->group); /* strip off extra articles if adding context is greater than $nntp_context */ diff --git a/pager.c b/pager.c index dfb96f3fd..e7c807e7f 100644 --- a/pager.c +++ b/pager.c @@ -35,8 +35,8 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "pager.h" #include "alias.h" #include "attach.h" #include "body.h" @@ -46,7 +46,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mailbox.h" #include "mbyte.h" #include "mutt_curses.h" @@ -56,6 +55,7 @@ #include "ncrypt/ncrypt.h" #include "opcodes.h" #include "options.h" +#include "pager.h" #include "pattern.h" #include "protos.h" #include "sort.h" @@ -99,7 +99,7 @@ static struct Header *OldHdr = NULL; } #define CHECK_ATTACH \ - if (option(OPT_ATTACH_MSG)) \ + if (option(OPT_ATTACH_MSG)) \ { \ mutt_flushinp(); \ mutt_error(_(Function_not_permitted_in_attach_message_mode)); \ @@ -914,7 +914,8 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, color_line = ColorBodyList; while (color_line) { - if (regexec(&color_line->regex, buf + offset, 1, pmatch, (offset ? REG_NOTBOL : 0)) == 0) + if (regexec(&color_line->regex, buf + offset, 1, pmatch, + (offset ? REG_NOTBOL : 0)) == 0) { if (pmatch[0].rm_eo != pmatch[0].rm_so) { @@ -982,7 +983,8 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, null_rx = false; for (color_line = ColorAttachList; color_line; color_line = color_line->next) { - if (regexec(&color_line->regex, buf + offset, 1, pmatch, (offset ? REG_NOTBOL : 0)) == 0) + if (regexec(&color_line->regex, buf + offset, 1, pmatch, + (offset ? REG_NOTBOL : 0)) == 0) { if (pmatch[0].rm_eo != pmatch[0].rm_so) { @@ -2921,7 +2923,8 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e !((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES) break; if (IsMsgAttach(extra)) - mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDNEWS | SENDREPLY); + 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; diff --git a/parameter.c b/parameter.c index da96b92b8..8d2346141 100644 --- a/parameter.c +++ b/parameter.c @@ -89,4 +89,3 @@ void mutt_delete_parameter(const char *attribute, struct Parameter **p) } } } - diff --git a/parse.c b/parse.c index e8e5d146a..24db10308 100644 --- a/parse.c +++ b/parse.c @@ -28,13 +28,13 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "body.h" #include "charset.h" #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" diff --git a/pattern.c b/pattern.c index 8411b3657..613ce916a 100644 --- a/pattern.c +++ b/pattern.c @@ -38,8 +38,8 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" -#include "pattern.h" #include "address.h" #include "body.h" #include "context.h" @@ -48,16 +48,15 @@ #include "globals.h" #include "group.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" -#include "mutt.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mutt_regex.h" #include "ncrypt/ncrypt.h" #include "opcodes.h" #include "options.h" +#include "pattern.h" #include "protos.h" #include "state.h" #include "thread.h" @@ -113,7 +112,8 @@ static bool eat_regexp(struct Pattern *pat, struct Buffer *s, struct Buffer *err else { pat->p.regex = safe_malloc(sizeof(regex_t)); - r = REGCOMP(pat->p.regex, buf.data, REG_NEWLINE | REG_NOSUB | mutt_which_case(buf.data)); + r = REGCOMP(pat->p.regex, buf.data, + REG_NEWLINE | REG_NOSUB | mutt_which_case(buf.data)); if (r) { regerror(r, pat->p.regex, errmsg, sizeof(errmsg)); diff --git a/pop.c b/pop.c index ee9ac2c1a..4e00ef9c5 100644 --- a/pop.c +++ b/pop.c @@ -28,6 +28,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "pop.h" #include "account.h" @@ -37,7 +38,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mailbox.h" #include "mutt_curses.h" #include "mutt_socket.h" diff --git a/pop_auth.c b/pop_auth.c index f97447645..9b8c200fc 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -24,15 +24,15 @@ #include #include #include +#include "lib/lib.h" +#include "mutt.h" #include "account.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_socket.h" #include "options.h" #include "pop.h" #include "protos.h" #include "rfc822.h" -#include "mutt.h" #ifdef USE_SASL #include #include diff --git a/pop_lib.c b/pop_lib.c index 3753bad86..4f9937ab6 100644 --- a/pop_lib.c +++ b/pop_lib.c @@ -28,12 +28,12 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "context.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_socket.h" #include "options.h" @@ -326,7 +326,8 @@ int pop_open_connection(struct PopData *pop_data) pop_data->use_stls = 2; if (pop_data->use_stls == 0) { - ret = query_quadoption(OPT_SSL_STARTTLS, _("Secure connection with TLS?")); + ret = + query_quadoption(OPT_SSL_STARTTLS, _("Secure connection with TLS?")); if (ret == MUTT_ABORT) return -2; pop_data->use_stls = 1; diff --git a/postpone.c b/postpone.c index 6eeaa337a..da1d58335 100644 --- a/postpone.c +++ b/postpone.c @@ -29,6 +29,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "body.h" #include "context.h" @@ -37,7 +38,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" @@ -573,7 +573,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, mutt_message(_("Decrypting message...")); if ((crypt_pgp_decrypt_mime(fp, &bfp, newhdr->content, &b) == -1) || b == NULL) { -err: + err: mx_close_message(ctx, &msg); mutt_free_envelope(&newhdr->env); mutt_free_body(&newhdr->content); @@ -597,7 +597,7 @@ err: newhdr->security |= SIGN; if ((WithCrypto & APPLICATION_PGP) && (mutt_strcasecmp(mutt_get_parameter("protocol", newhdr->content->parameter), - "application/pgp-signature") == 0)) + "application/pgp-signature") == 0)) newhdr->security |= APPLICATION_PGP; else if ((WithCrypto & APPLICATION_SMIME)) newhdr->security |= APPLICATION_SMIME; diff --git a/query.c b/query.c index 9d49ae5c7..82e482c47 100644 --- a/query.c +++ b/query.c @@ -30,6 +30,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -39,7 +40,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_idna.h" #include "mutt_menu.h" @@ -259,7 +259,7 @@ static void query_entry(char *s, size_t slen, struct Menu *m, int num) entry->data->num = num; mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(QueryFormat), - query_format_str, (unsigned long) entry, MUTT_FORMAT_ARROWCURSOR); + query_format_str, (unsigned long) entry, MUTT_FORMAT_ARROWCURSOR); } static int query_tag(struct Menu *menu, int n, int m) diff --git a/recvattach.c b/recvattach.c index 4d50919ed..56a7b5ee0 100644 --- a/recvattach.c +++ b/recvattach.c @@ -31,6 +31,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "attach.h" #include "body.h" @@ -41,7 +42,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mailbox.h" #include "mime.h" #include "mutt_curses.h" @@ -1311,26 +1311,30 @@ void mutt_view_attachments(struct Header *hdr) case OP_RESEND: CHECK_ATTACH; - mutt_attach_resend(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content); + mutt_attach_resend(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content); menu->redraw = REDRAW_FULL; break; case OP_BOUNCE_MESSAGE: CHECK_ATTACH; - mutt_attach_bounce(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content); + mutt_attach_bounce(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content); menu->redraw = REDRAW_FULL; break; case OP_FORWARD_MESSAGE: CHECK_ATTACH; - mutt_attach_forward(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content, 0); + mutt_attach_forward(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content, 0); menu->redraw = REDRAW_FULL; break; #ifdef USE_NNTP case OP_FORWARD_TO_GROUP: CHECK_ATTACH; - mutt_attach_forward(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content, SENDNEWS); + mutt_attach_forward(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content, SENDNEWS); menu->redraw = REDRAW_FULL; break; @@ -1338,11 +1342,13 @@ void mutt_view_attachments(struct Header *hdr) CHECK_ATTACH; if (!CURATTACH->content->hdr->env->followup_to || - (mutt_strcasecmp(CURATTACH->content->hdr->env->followup_to, "poster") != 0) || + (mutt_strcasecmp(CURATTACH->content->hdr->env->followup_to, + "poster") != 0) || query_quadoption(OPT_FOLLOWUP_TO_POSTER, _("Reply by mail as poster prefers?")) != MUTT_YES) { - mutt_attach_reply(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content, + mutt_attach_reply(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content, SENDNEWS | SENDREPLY); menu->redraw = REDRAW_FULL; break; @@ -1357,7 +1363,8 @@ void mutt_view_attachments(struct Header *hdr) flags = SENDREPLY | (op == OP_GROUP_REPLY ? SENDGROUPREPLY : 0) | (op == OP_LIST_REPLY ? SENDLISTREPLY : 0); - mutt_attach_reply(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content, flags); + mutt_attach_reply(CURATTACH->fp, hdr, actx, + menu->tagprefix ? NULL : CURATTACH->content, flags); menu->redraw = REDRAW_FULL; break; diff --git a/recvcmd.c b/recvcmd.c index ec39e5296..c1c0ce355 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -25,6 +25,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "alias.h" #include "attach.h" @@ -33,7 +34,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_idna.h" #include "options.h" @@ -431,7 +431,8 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx if (option(OPT_FORWARD_QUOTE)) { if (!option(OPT_TEXT_FLOWED)) - _mutt_make_string(prefix, sizeof(prefix), NONULL(IndentString), Context, parent_hdr, 0); + _mutt_make_string(prefix, sizeof(prefix), NONULL(IndentString), Context, + parent_hdr, 0); else strfcpy(prefix, ">", sizeof(prefix)); } @@ -581,7 +582,8 @@ static void attach_forward_msgs(FILE *fp, struct Header *hdr, tmpbody[0] = '\0'; - if ((rc = query_quadoption(OPT_MIME_FORWARD, _("Forward MIME encapsulated?"))) == MUTT_NO) + if ((rc = query_quadoption(OPT_MIME_FORWARD, + _("Forward MIME encapsulated?"))) == MUTT_NO) { /* no MIME encapsulation */ @@ -875,7 +877,8 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx, st.fpout = tmpfp; if (!option(OPT_TEXT_FLOWED)) - _mutt_make_string(prefix, sizeof(prefix), NONULL(IndentString), Context, parent_hdr, 0); + _mutt_make_string(prefix, sizeof(prefix), NONULL(IndentString), Context, + parent_hdr, 0); else strfcpy(prefix, ">", sizeof(prefix)); diff --git a/remailer.c b/remailer.c index 6873f38e5..dfad703f5 100644 --- a/remailer.c +++ b/remailer.c @@ -30,6 +30,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "remailer.h" #include "address.h" @@ -39,7 +40,6 @@ #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "list.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -189,7 +189,7 @@ static struct Remailer **mix_type2_list(size_t *l) mix_add_entry(&type2_list, p, &slots, &used); continue; -problem: + problem: mix_free_remailer(&p); } @@ -412,7 +412,7 @@ static void mix_entry(char *b, size_t blen, struct Menu *menu, int num) { struct Remailer **type2_list = (struct Remailer **) menu->data; mutt_expando_format(b, blen, 0, MuttIndexWindow->cols, NONULL(MixEntryFormat), mix_entry_fmt, - (unsigned long) type2_list[num], MUTT_FORMAT_ARROWCURSOR); + (unsigned long) type2_list[num], MUTT_FORMAT_ARROWCURSOR); } static int mix_chain_add(struct MixChain *chain, const char *s, struct Remailer **type2_list) @@ -724,7 +724,7 @@ int mix_send_message(struct ListHead *chain, const char *tempfile) strfcpy(tmp, cmd, sizeof(tmp)); mutt_quote_filename(cd_quoted, sizeof(cd_quoted), np->data); snprintf(cmd, sizeof(cmd), "%s%s%s", tmp, - (np == STAILQ_FIRST(chain)) ? " -l " : ",", cd_quoted); + (np == STAILQ_FIRST(chain)) ? " -l " : ",", cd_quoted); } if (!option(OPT_NO_CURSES)) diff --git a/rfc1524.c b/rfc1524.c index 242bd0102..9cc16e9a8 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -35,11 +35,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "rfc1524.h" #include "body.h" #include "globals.h" -#include "lib/lib.h" #include "options.h" #include "parameter.h" #include "protos.h" diff --git a/rfc2047.c b/rfc2047.c index 239dce73d..feedb182d 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -26,11 +26,11 @@ #include #include #include +#include "lib/lib.h" #include "rfc2047.h" #include "address.h" #include "charset.h" #include "globals.h" -#include "lib/lib.h" #include "mbyte.h" #include "mime.h" #include "options.h" diff --git a/rfc2231.c b/rfc2231.c index 5760c6c97..2092bd228 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -34,10 +34,10 @@ #include #include #include +#include "lib/lib.h" #include "rfc2231.h" #include "charset.h" #include "globals.h" -#include "lib/lib.h" #include "mbyte.h" #include "mime.h" #include "options.h" diff --git a/rfc3676.c b/rfc3676.c index 729107cb9..582d44488 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -31,11 +31,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "body.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "options.h" #include "parameter.h" diff --git a/rfc822.c b/rfc822.c index fc8835d1b..71388e825 100644 --- a/rfc822.c +++ b/rfc822.c @@ -23,8 +23,8 @@ #include "config.h" #include #include -#include "rfc822.h" #include "lib/lib.h" +#include "rfc822.h" #include "mutt_idna.h" const char RFC822Specials[] = "@.,:;<>[]\\\"()"; diff --git a/score.c b/score.c index ab51ae982..98362a24d 100644 --- a/score.c +++ b/score.c @@ -23,12 +23,12 @@ #include "config.h" #include #include +#include "lib/lib.h" #include "mutt.h" #include "context.h" #include "globals.h" #include "header.h" #include "keymap.h" -#include "lib/lib.h" #include "mutt_menu.h" #include "options.h" #include "pattern.h" diff --git a/send.c b/send.c index e8e2421b8..8301ebc38 100644 --- a/send.c +++ b/send.c @@ -32,6 +32,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "alias.h" @@ -42,7 +43,6 @@ #include "filter.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" @@ -267,7 +267,8 @@ static int edit_envelope(struct Envelope *en, int flags) strfcpy(buf, en->followup_to, sizeof(buf)); else buf[0] = 0; - if (option(OPT_ASK_FOLLOW_UP) && mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0) + if (option(OPT_ASK_FOLLOW_UP) && + mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0) return -1; FREE(&en->followup_to); en->followup_to = safe_strdup(buf); @@ -291,7 +292,8 @@ static int edit_envelope(struct Envelope *en, int flags) return -1; if (option(OPT_ASKBCC) && edit_address(&en->bcc, _("Bcc: ")) == -1) return -1; - if (option(OPT_REPLY_WITH_XORIG) && (flags & (SENDREPLY | SENDLISTREPLY | SENDGROUPREPLY)) && + if (option(OPT_REPLY_WITH_XORIG) && + (flags & (SENDREPLY | SENDLISTREPLY | SENDGROUPREPLY)) && (edit_address(&en->from, "From: ") == -1)) return -1; } @@ -320,7 +322,8 @@ static int edit_envelope(struct Envelope *en, int flags) } if (mutt_get_field(_("Subject: "), buf, sizeof(buf), 0) != 0 || - (!buf[0] && query_quadoption(OPT_ABORT_NOSUBJECT, _("No subject, abort?")) != MUTT_NO)) + (!buf[0] && + query_quadoption(OPT_ABORT_NOSUBJECT, _("No subject, abort?")) != MUTT_NO)) { mutt_message(_("No subject, aborting.")); return -1; @@ -1472,7 +1475,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, msg->env->from->mailbox); msg->env->from = set_reverse_name(cur->env); } - if (cur && option(OPT_REPLY_WITH_XORIG) && !(flags & (SENDPOSTPONED | SENDRESEND | SENDFORWARD))) + if (cur && option(OPT_REPLY_WITH_XORIG) && + !(flags & (SENDPOSTPONED | SENDRESEND | SENDFORWARD))) { /* We shouldn't have to worry about freeing `msg->env->from' before * setting it here since this code will only execute when doing some @@ -1515,7 +1519,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, msg->env->newsgroups = safe_strdup(((struct NntpData *) ctx->data)->group); #endif - if (!(flags & (SENDMAILX | SENDBATCH)) && !(option(OPT_AUTOEDIT) && option(OPT_EDIT_HEADERS)) && + if (!(flags & (SENDMAILX | SENDBATCH)) && + !(option(OPT_AUTOEDIT) && option(OPT_EDIT_HEADERS)) && !((flags & SENDREPLY) && option(OPT_FAST_REPLY))) { if (edit_envelope(msg->env, flags) == -1) @@ -1683,7 +1688,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, { /* if the file was not modified, bail out now */ if (mtime == st.st_mtime && !msg->content->next && - query_quadoption(OPT_ABORT_UNMODIFIED, _("Abort unmodified message?")) == MUTT_YES) + query_quadoption(OPT_ABORT_UNMODIFIED, + _("Abort unmodified message?")) == MUTT_YES) { mutt_message(_("Aborted unmodified message.")); goto cleanup; @@ -1922,7 +1928,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, } if (!msg->env->subject && !(flags & SENDBATCH) && - (i = query_quadoption(OPT_ABORT_NOSUBJECT, _("No subject, abort sending?"))) != MUTT_NO) + (i = query_quadoption(OPT_ABORT_NOSUBJECT, + _("No subject, abort sending?"))) != MUTT_NO) { /* if the abort is automatic, print an error message */ if (quadoption(OPT_ABORT_NOSUBJECT) == MUTT_YES) @@ -1945,7 +1952,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, if (quadoption(OPT_ABORT_NOATTACH) != MUTT_NO && !msg->content->next && search_attach_keyword(msg->content->filename) && - query_quadoption(OPT_ABORT_NOATTACH, _("No attachments, cancel sending?")) != MUTT_NO) + query_quadoption(OPT_ABORT_NOATTACH, + _("No attachments, cancel sending?")) != MUTT_NO) { /* if the abort is automatic, print an error message */ if (quadoption(OPT_ABORT_NOATTACH) == MUTT_YES) diff --git a/sendlib.c b/sendlib.c index 2800761e5..cd662c995 100644 --- a/sendlib.c +++ b/sendlib.c @@ -38,6 +38,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "address.h" #include "body.h" @@ -51,7 +52,6 @@ #include "format_flags.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "mailbox.h" #include "mime.h" @@ -1337,7 +1337,8 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i if (WithCrypto) { - if ((option(OPT_MIME_FORWARD_DECODE) || option(OPT_FORWARD_DECRYPT)) && (hdr->security & ENCRYPT)) + if ((option(OPT_MIME_FORWARD_DECODE) || option(OPT_FORWARD_DECRYPT)) && + (hdr->security & ENCRYPT)) { if (!crypt_valid_passphrase(hdr->security)) return NULL; @@ -1461,7 +1462,8 @@ struct Body *mutt_make_file_attach(const char *path) if (!att->subtype) mutt_lookup_mime_type(att, path); - if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand && !option(OPT_MIME_TYPE_QUERY_FIRST)) + if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand && + !option(OPT_MIME_TYPE_QUERY_FIRST)) run_mime_type_query(att); if ((info = mutt_get_content_info(path, att)) == NULL) @@ -1633,7 +1635,7 @@ void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim) break; } - struct ListNode **ref = safe_calloc(length, sizeof(struct ListNode*)); + struct ListNode **ref = safe_calloc(length, sizeof(struct ListNode *)); // store in reverse order size_t tmp = length; @@ -2495,8 +2497,8 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres { char cmd[LONG_STRING]; - mutt_expando_format(cmd, sizeof(cmd), 0, MuttIndexWindow->cols, NONULL(Inews), - nntp_format_str, 0, 0); + mutt_expando_format(cmd, sizeof(cmd), 0, MuttIndexWindow->cols, + NONULL(Inews), nntp_format_str, 0, 0); if (!*cmd) { i = nntp_post(msg); @@ -2612,7 +2614,8 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres if (!option(OPT_NO_CURSES)) mutt_need_hard_redraw(); - if ((i = send_msg(path, args, msg, option(OPT_NO_CURSES) ? NULL : &childout)) != (EX_OK & 0xff)) + if ((i = send_msg(path, args, msg, option(OPT_NO_CURSES) ? NULL : &childout)) != + (EX_OK & 0xff)) { if (i != S_BKG) { diff --git a/sidebar.c b/sidebar.c index 510522afa..29f72bf33 100644 --- a/sidebar.c +++ b/sidebar.c @@ -28,13 +28,13 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "sidebar.h" #include "buffy.h" #include "context.h" #include "format_flags.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_menu.h" #include "mx.h" @@ -222,11 +222,11 @@ static const char *cb_format_str(char *dest, size_t destlen, size_t col, int col } if (optional) - mutt_expando_format(dest, destlen, col, SidebarWidth, ifstring, cb_format_str, - (unsigned long) sbe, flags); + mutt_expando_format(dest, destlen, col, SidebarWidth, ifstring, + cb_format_str, (unsigned long) sbe, flags); else if (flags & MUTT_FORMAT_OPTIONAL) mutt_expando_format(dest, destlen, col, SidebarWidth, elsestring, - cb_format_str, (unsigned long) sbe, flags); + cb_format_str, (unsigned long) sbe, flags); /* We return the format string, unchanged */ return src; @@ -252,8 +252,8 @@ static void make_sidebar_entry(char *buf, unsigned int buflen, int width, strfcpy(sbe->box, box, sizeof(sbe->box)); - mutt_expando_format(buf, buflen, 0, width, NONULL(SidebarFormat), cb_format_str, - (unsigned long) sbe, 0); + mutt_expando_format(buf, buflen, 0, width, NONULL(SidebarFormat), + cb_format_str, (unsigned long) sbe, 0); /* Force string to be exactly the right width */ int w = mutt_strwidth(buf); @@ -859,15 +859,14 @@ static void draw_sidebar(int num_rows, int num_cols, int div_width) /* compute length of Folder without trailing separator */ size_t maildirlen = mutt_strlen(Folder); - if (maildirlen && SidebarDelimChars && - strchr(SidebarDelimChars, Folder[maildirlen - 1])) + if (maildirlen && SidebarDelimChars && strchr(SidebarDelimChars, Folder[maildirlen - 1])) maildirlen--; /* check whether Folder is a prefix of the current folder's path */ bool maildir_is_prefix = false; if ((mutt_strlen(b->path) > maildirlen) && - (mutt_strncmp(Folder, b->path, maildirlen) == 0) && - SidebarDelimChars && strchr(SidebarDelimChars, b->path[maildirlen])) + (mutt_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 */ diff --git a/signal.c b/signal.c index 0ad1788ac..e6fb41641 100644 --- a/signal.c +++ b/signal.c @@ -26,8 +26,8 @@ #include #include #include -#include "globals.h" #include "lib/lib.h" +#include "globals.h" #include "mutt_curses.h" #include "options.h" diff --git a/smtp.c b/smtp.c index 506957c52..2df073377 100644 --- a/smtp.c +++ b/smtp.c @@ -31,11 +31,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "account.h" #include "address.h" #include "globals.h" -#include "lib/lib.h" #include "mutt_curses.h" #include "mutt_socket.h" #include "options.h" diff --git a/sort.c b/sort.c index e41c5bb3c..b76a66ff0 100644 --- a/sort.c +++ b/sort.c @@ -23,6 +23,7 @@ #include "config.h" #include #include +#include "lib/lib.h" #include "mutt.h" #include "sort.h" #include "address.h" @@ -31,7 +32,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "mutt_idna.h" #include "options.h" #include "protos.h" @@ -47,11 +47,11 @@ static sort_t *AuxSort = NULL; #define AUXSORT(code, a, b) \ - if (!code && AuxSort && !option(OPT_AUX_SORT)) \ + if (!code && AuxSort && !option(OPT_AUX_SORT)) \ { \ - set_option(OPT_AUX_SORT); \ + set_option(OPT_AUX_SORT); \ code = AuxSort(a, b); \ - unset_option(OPT_AUX_SORT); \ + unset_option(OPT_AUX_SORT); \ } \ if (!code) \ code = (*((struct Header **) a))->index - (*((struct Header **) b))->index; diff --git a/state.c b/state.c index 49a575165..108b6e9ef 100644 --- a/state.c +++ b/state.c @@ -111,4 +111,3 @@ void state_prefix_put(const char *d, size_t dlen, struct State *s) else fwrite(d, dlen, 1, s->fpout); } - diff --git a/status.c b/status.c index 3ee336e7b..01b9174fd 100644 --- a/status.c +++ b/status.c @@ -22,10 +22,10 @@ #include "config.h" #include +#include "lib/lib.h" #include "context.h" #include "format_flags.h" #include "globals.h" -#include "lib/lib.h" #include "mbtable.h" #include "mutt_curses.h" #include "mutt_menu.h" @@ -327,12 +327,13 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c static void _menu_status_line(char *buf, size_t buflen, size_t col, int cols, struct Menu *menu, const char *p) { - mutt_expando_format(buf, buflen, col, cols, p, status_format_str, (unsigned long) menu, 0); + mutt_expando_format(buf, buflen, col, cols, p, status_format_str, + (unsigned long) menu, 0); } void menu_status_line(char *buf, size_t buflen, struct Menu *menu, const char *p) { mutt_expando_format(buf, buflen, 0, - menu ? menu->statuswin->cols : MuttStatusWindow->cols, p, - status_format_str, (unsigned long) menu, 0); + menu ? menu->statuswin->cols : MuttStatusWindow->cols, p, + status_format_str, (unsigned long) menu, 0); } diff --git a/thread.c b/thread.c index b090e22c8..306c37e29 100644 --- a/thread.c +++ b/thread.c @@ -25,6 +25,7 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "thread.h" #include "body.h" @@ -32,7 +33,6 @@ #include "envelope.h" #include "globals.h" #include "header.h" -#include "lib/lib.h" #include "list.h" #include "options.h" #include "protos.h" @@ -388,7 +388,7 @@ static void make_subject_list(struct ListHead *subjects, struct MuttThread *cur, if (dateptr) { thisdate = option(OPT_THREAD_RECEIVED) ? cur->message->received : - cur->message->date_sent; + cur->message->date_sent; if (!*dateptr || thisdate < *dateptr) *dateptr = thisdate; } @@ -404,9 +404,9 @@ static void make_subject_list(struct ListHead *subjects, struct MuttThread *cur, break; } if (!np) - mutt_list_insert_head(subjects, env->real_subj); + mutt_list_insert_head(subjects, env->real_subj); else if (rc > 0) - mutt_list_insert_after(subjects, np, env->real_subj); + mutt_list_insert_after(subjects, np, env->real_subj); } while (!cur->next && cur != start) @@ -445,7 +445,7 @@ static struct MuttThread *find_subject(struct Context *ctx, struct MuttThread *c tmp->message->subject_changed && /* only match interesting replies */ !is_descendant(tmp, cur) && /* don't match in the same thread */ (date >= (option(OPT_THREAD_RECEIVED) ? tmp->message->received : - tmp->message->date_sent)) && + tmp->message->date_sent)) && (!last || (option(OPT_THREAD_RECEIVED) ? (last->message->received < tmp->message->received) : (last->message->date_sent < tmp->message->date_sent))) && @@ -1411,8 +1411,7 @@ static void clean_references(struct MuttThread *brk, struct MuttThread *cur) for (p = brk; !done && p; p = p->parent) { for (ref = STAILQ_FIRST(&cur->message->env->references); - p->message && ref; - ref = STAILQ_NEXT(ref, entries)) + p->message && ref; ref = STAILQ_NEXT(ref, entries)) { if (mutt_strcasecmp(ref->data, p->message->env->message_id) == 0) { diff --git a/url.c b/url.c index 6b4cc44f0..1d01483d8 100644 --- a/url.c +++ b/url.c @@ -28,11 +28,11 @@ #include #include #include +#include "lib/lib.h" #include "mutt.h" #include "url.h" #include "envelope.h" #include "globals.h" -#include "lib/lib.h" #include "mime.h" #include "protos.h" #include "rfc2047.h"