changeset: 6983:77032036c642 user: Kevin McCarthy <ke...@8t8.us> date: Mon Mar 27 11:39:42 2017 -0700 link: http://dev.mutt.org/hg/mutt/rev/77032036c642
Fix (un)sidebar_whitelist to expand paths. Thanks to Arturo for reporting the issue. changeset: 6984:4c7881c441e7 user: Kevin McCarthy <ke...@8t8.us> date: Mon Mar 27 11:46:26 2017 -0700 link: http://dev.mutt.org/hg/mutt/rev/4c7881c441e7 merge stable diffs (truncated from 2539 to 950 lines): diff -r 9da67ea88f25 -r 4c7881c441e7 addrbook.c --- a/addrbook.c Sun Mar 26 12:27:15 2017 -0700 +++ b/addrbook.c Mon Mar 27 11:46:26 2017 -0700 @@ -145,15 +145,13 @@ mutt_error _("You have no aliases!"); return; } - - /* tell whoever called me to redraw the screen when I return */ - set_option (OPTNEEDREDRAW); - + menu = mutt_new_menu (MENU_ALIAS); menu->make_entry = alias_entry; menu->tag = alias_tag; menu->title = _("Aliases"); menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ALIAS, AliasHelp); + mutt_push_current_menu (menu); new_aliases: @@ -237,6 +235,7 @@ rfc822_write_address (buf, buflen, AliasTable[t]->addr, 1); } + mutt_pop_current_menu (menu); mutt_menuDestroy (&menu); FREE (&AliasTable); diff -r 9da67ea88f25 -r 4c7881c441e7 browser.c --- a/browser.c Sun Mar 26 12:27:15 2017 -0700 +++ b/browser.c Mon Mar 27 11:46:26 2017 -0700 @@ -492,17 +492,20 @@ tmp->msg_unread = Context->unread; } + strfcpy (buffer, NONULL (tmp->path), sizeof (buffer)); + mutt_pretty_mailbox (buffer, sizeof (buffer)); + #ifdef USE_IMAP if (mx_is_imap (tmp->path)) { - add_folder (menu, state, tmp->path, NULL, tmp); + add_folder (menu, state, buffer, NULL, tmp); continue; } #endif #ifdef USE_POP if (mx_is_pop (tmp->path)) { - add_folder (menu, state, tmp->path, NULL, tmp); + add_folder (menu, state, buffer, NULL, tmp); continue; } #endif @@ -528,9 +531,6 @@ s.st_mtime = st2.st_mtime; } - strfcpy (buffer, NONULL(tmp->path), sizeof (buffer)); - mutt_pretty_mailbox (buffer, sizeof (buffer)); - add_folder (menu, state, buffer, &s, tmp); } while ((tmp = tmp->next)); @@ -611,7 +611,7 @@ char helpstr[LONG_STRING]; char title[STRING]; struct browser_state state; - MUTTMENU *menu; + MUTTMENU *menu = NULL; struct stat st; int i, killPrefix = 0; int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0; @@ -722,6 +722,7 @@ menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER, FolderHelp); + mutt_push_current_menu (menu); init_menu (&state, menu, title, sizeof (title), buffy); @@ -908,7 +909,6 @@ } destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; case OP_BROWSER_TELL: @@ -954,7 +954,6 @@ menu->current = 0; menu->top = 0; init_menu (&state, menu, title, sizeof (title), buffy); - MAYBE_REDRAW (menu->redraw); } /* else leave error on screen */ break; @@ -977,7 +976,6 @@ menu->current = 0; menu->top = 0; init_menu (&state, menu, title, sizeof (title), buffy); - MAYBE_REDRAW (menu->redraw); } } break; @@ -1015,7 +1013,6 @@ state.entrylen--; mutt_message _("Mailbox deleted."); init_menu (&state, menu, title, sizeof (title), buffy); - MAYBE_REDRAW (menu->redraw); } } else @@ -1080,7 +1077,6 @@ mutt_error _("Error scanning directory."); if (examine_directory (menu, &state, LastDir, prefix) == -1) { - mutt_menuDestroy (&menu); goto bail; } } @@ -1095,7 +1091,6 @@ mutt_perror (buf); } } - MAYBE_REDRAW (menu->redraw); break; case OP_ENTER_MASK: @@ -1151,7 +1146,6 @@ else { mutt_error _("Error scanning directory."); - mutt_menuDestroy (&menu); goto bail; } killPrefix = 0; @@ -1162,7 +1156,6 @@ } } } - MAYBE_REDRAW (menu->redraw); break; case OP_SORT: @@ -1246,10 +1239,8 @@ { strfcpy (f, buf, flen); destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; } - MAYBE_REDRAW (menu->redraw); break; case OP_BROWSER_VIEW_FILE: @@ -1264,7 +1255,6 @@ { strfcpy (f, state.entry[menu->current].name, flen); destroy_state (&state); - mutt_menuDestroy (&menu); goto bail; } else @@ -1296,7 +1286,13 @@ } bail: - + + if (menu) + { + mutt_pop_current_menu (menu); + mutt_menuDestroy (&menu); + } + if (!folder) strfcpy (LastDir, LastDirBackup, sizeof (LastDir)); diff -r 9da67ea88f25 -r 4c7881c441e7 commands.c --- a/commands.c Sun Mar 26 12:27:15 2017 -0700 +++ b/commands.c Mon Mar 27 11:46:26 2017 -0700 @@ -238,7 +238,7 @@ return rc; } -void ci_bounce_message (HEADER *h, int *redraw) +void ci_bounce_message (HEADER *h) { char prompt[SHORT_STRING]; char scratch[SHORT_STRING]; @@ -276,13 +276,6 @@ strfcpy(prompt, _("Bounce tagged messages to: "), sizeof(prompt)); rc = mutt_get_field (prompt, buf, sizeof (buf), MUTT_ALIAS); - - if (option (OPTNEEDREDRAW)) - { - unset_option (OPTNEEDREDRAW); - *redraw = REDRAW_FULL; - } - if (rc || !buf[0]) return; diff -r 9da67ea88f25 -r 4c7881c441e7 compose.c --- a/compose.c Sun Mar 26 12:27:15 2017 -0700 +++ b/compose.c Mon Mar 27 11:46:26 2017 -0700 @@ -273,7 +273,7 @@ NORMAL_COLOR; } -static int edit_address_list (int line, ADDRESS **addr) +static void edit_address_list (int line, ADDRESS **addr) { char buf[HUGE_STRING] = ""; /* needs to be large for alias expansion */ char *err = NULL; @@ -287,12 +287,6 @@ *addr = mutt_expand_aliases (*addr); } - if (option (OPTNEEDREDRAW)) - { - unset_option (OPTNEEDREDRAW); - return (REDRAW_FULL); - } - if (mutt_addrlist_to_intl (*addr, &err) != 0) { mutt_error (_("Warning: '%s' is a bad IDN."), err); @@ -305,8 +299,6 @@ rfc822_write_address (buf, sizeof (buf), *addr, 1); mutt_window_move (MuttIndexWindow, line, HDR_XOFFSET); mutt_paddstr (W, buf); - - return 0; } static int delete_attachment (MUTTMENU *menu, short *idxlen, int x) @@ -516,6 +508,7 @@ menu->tag = mutt_tag_attach; menu->data = idx; menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_COMPOSE, ComposeHelp); + mutt_push_current_menu (menu); while (loop) { @@ -527,11 +520,11 @@ menu->pagelen = MuttIndexWindow->rows - HDR_ATTACH; break; case OP_COMPOSE_EDIT_FROM: - menu->redraw = edit_address_list (HDR_FROM, &msg->env->from); + edit_address_list (HDR_FROM, &msg->env->from); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_TO: - menu->redraw = edit_address_list (HDR_TO, &msg->env->to); + edit_address_list (HDR_TO, &msg->env->to); if (option (OPTCRYPTOPPORTUNISTICENCRYPT)) { crypt_opportunistic_encrypt (msg); @@ -540,7 +533,7 @@ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_BCC: - menu->redraw = edit_address_list (HDR_BCC, &msg->env->bcc); + edit_address_list (HDR_BCC, &msg->env->bcc); if (option (OPTCRYPTOPPORTUNISTICENCRYPT)) { crypt_opportunistic_encrypt (msg); @@ -549,7 +542,7 @@ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_CC: - menu->redraw = edit_address_list (HDR_CC, &msg->env->cc); + edit_address_list (HDR_CC, &msg->env->cc); if (option (OPTCRYPTOPPORTUNISTICENCRYPT)) { crypt_opportunistic_encrypt (msg); @@ -574,7 +567,7 @@ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_REPLY_TO: - menu->redraw = edit_address_list (HDR_REPLYTO, &msg->env->reply_to); + edit_address_list (HDR_REPLYTO, &msg->env->reply_to); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_FCC: @@ -587,7 +580,6 @@ mutt_paddstr (W, fcc); fccSet = 1; } - MAYBE_REDRAW (menu->redraw); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_MESSAGE: @@ -666,12 +658,6 @@ FREE (&idx[idxlen]); menu->redraw |= REDRAW_STATUS; - - if (option(OPTNEEDREDRAW)) - { - menu->redraw = REDRAW_FULL; - unset_option(OPTNEEDREDRAW); - } mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1163,7 +1149,6 @@ case OP_SAVE: CHECK_COUNT; mutt_save_attachment_list (NULL, menu->tagprefix, menu->tagprefix ? msg->content : idx[menu->current]->content, NULL, menu); - MAYBE_REDRAW (menu->redraw); /* no send2hook, since this doesn't modify the message */ break; @@ -1287,7 +1272,7 @@ crypt_opportunistic_encrypt (msg); redraw_crypt_lines (msg); } - msg->security = crypt_pgp_send_menu (msg, &menu->redraw); + msg->security = crypt_pgp_send_menu (msg); redraw_crypt_lines (msg); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1320,7 +1305,7 @@ crypt_opportunistic_encrypt (msg); redraw_crypt_lines (msg); } - msg->security = crypt_smime_send_menu(msg, &menu->redraw); + msg->security = crypt_smime_send_menu(msg); redraw_crypt_lines (msg); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1329,7 +1314,7 @@ #ifdef MIXMASTER case OP_COMPOSE_MIX: - mix_make_chain (&msg->chain, &menu->redraw); + mix_make_chain (&msg->chain); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; #endif @@ -1348,6 +1333,7 @@ } } + mutt_pop_current_menu (menu); mutt_menuDestroy (&menu); if (idxlen) diff -r 9da67ea88f25 -r 4c7881c441e7 configure.ac --- a/configure.ac Sun Mar 26 12:27:15 2017 -0700 +++ b/configure.ac Mon Mar 27 11:46:26 2017 -0700 @@ -710,6 +710,11 @@ AC_CHECK_DECLS([SSL_set_mode, SSL_MODE_AUTO_RETRY],, AC_MSG_ERROR([Unable to find decent SSL header]), [[#include <openssl/ssl.h>]]) + AC_CHECK_DECL([X509_V_FLAG_PARTIAL_CHAIN], + AC_DEFINE(HAVE_SSL_PARTIAL_CHAIN,1,[ Define if OpenSSL supports partial chains. ]), + , + [[#include <openssl/x509_vfy.h>]]) + AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ]) AC_DEFINE(USE_SSL_OPENSSL,1,[ Define if you want support for SSL via OpenSSL. ]) LIBS="$saved_LIBS" diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-gpgme.c --- a/crypt-gpgme.c Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-gpgme.c Mon Mar 27 11:46:26 2017 -0700 @@ -4031,6 +4031,7 @@ menu->make_entry = crypt_entry; menu->help = helpstr; menu->data = key_table; + mutt_push_current_menu (menu); { const char *ts; @@ -4139,10 +4140,9 @@ } } + mutt_pop_current_menu (menu); mutt_menuDestroy (&menu); FREE (&key_table); - - set_option (OPTNEEDREDRAW); return k; } @@ -4701,7 +4701,7 @@ init_smime (); } -static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime) +static int gpgme_send_menu (HEADER *msg, int is_smime) { crypt_key_t *p; char input_signas[SHORT_STRING]; @@ -4806,7 +4806,6 @@ msg->security |= SIGN; } - *redraw = REDRAW_FULL; break; case 'b': /* (b)oth */ @@ -4853,14 +4852,14 @@ return (msg->security); } -int pgp_gpgme_send_menu (HEADER *msg, int *redraw) +int pgp_gpgme_send_menu (HEADER *msg) { - return gpgme_send_menu (msg, redraw, 0); + return gpgme_send_menu (msg, 0); } -int smime_gpgme_send_menu (HEADER *msg, int *redraw) +int smime_gpgme_send_menu (HEADER *msg) { - return gpgme_send_menu (msg, redraw, 1); + return gpgme_send_menu (msg, 1); } static int verify_sender (HEADER *h, gpgme_protocol_t protocol) diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-gpgme.h --- a/crypt-gpgme.h Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-gpgme.h Mon Mar 27 11:46:26 2017 -0700 @@ -48,8 +48,8 @@ int pgp_gpgme_verify_one (BODY *sigbdy, STATE *s, const char *tempfile); int smime_gpgme_verify_one (BODY *sigbdy, STATE *s, const char *tempfile); -int pgp_gpgme_send_menu (HEADER *msg, int *redraw); -int smime_gpgme_send_menu (HEADER *msg, int *redraw); +int pgp_gpgme_send_menu (HEADER *msg); +int smime_gpgme_send_menu (HEADER *msg); int smime_gpgme_verify_sender (HEADER *h); diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-mod-pgp-classic.c --- a/crypt-mod-pgp-classic.c Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-mod-pgp-classic.c Mon Mar 27 11:46:26 2017 -0700 @@ -61,9 +61,9 @@ return pgp_verify_one (sigbdy, s, tempf); } -static int crypt_mod_pgp_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_pgp_send_menu (HEADER *msg) { - return pgp_send_menu (msg, redraw); + return pgp_send_menu (msg); } static BODY *crypt_mod_pgp_encrypt_message (BODY *a, char *keylist, int sign) diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-mod-pgp-gpgme.c --- a/crypt-mod-pgp-gpgme.c Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-mod-pgp-gpgme.c Mon Mar 27 11:46:26 2017 -0700 @@ -85,9 +85,9 @@ return pgp_gpgme_verify_one (sigbdy, s, tempf); } -static int crypt_mod_pgp_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_pgp_send_menu (HEADER *msg) { - return pgp_gpgme_send_menu (msg, redraw); + return pgp_gpgme_send_menu (msg); } static BODY *crypt_mod_pgp_encrypt_message (BODY *a, char *keylist, int sign) diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-mod-smime-classic.c --- a/crypt-mod-smime-classic.c Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-mod-smime-classic.c Mon Mar 27 11:46:26 2017 -0700 @@ -61,9 +61,9 @@ return smime_verify_one (sigbdy, s, tempf); } -static int crypt_mod_smime_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_smime_send_menu (HEADER *msg) { - return smime_send_menu (msg, redraw); + return smime_send_menu (msg); } static void crypt_mod_smime_getkeys (ENVELOPE *env) diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-mod-smime-gpgme.c --- a/crypt-mod-smime-gpgme.c Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-mod-smime-gpgme.c Mon Mar 27 11:46:26 2017 -0700 @@ -70,9 +70,9 @@ return smime_gpgme_verify_one (sigbdy, s, tempf); } -static int crypt_mod_smime_send_menu (HEADER *msg, int *redraw) +static int crypt_mod_smime_send_menu (HEADER *msg) { - return smime_gpgme_send_menu (msg, redraw); + return smime_gpgme_send_menu (msg); } static BODY *crypt_mod_smime_build_smime_entity (BODY *a, char *certlist) diff -r 9da67ea88f25 -r 4c7881c441e7 crypt-mod.h --- a/crypt-mod.h Sun Mar 26 12:27:15 2017 -0700 +++ b/crypt-mod.h Mon Mar 27 11:46:26 2017 -0700 @@ -53,7 +53,7 @@ typedef void (*crypt_func_pgp_extract_keys_from_attachment_list_t) (FILE *fp, int tag, BODY *top); -typedef int (*crypt_func_send_menu_t) (HEADER *msg, int *redraw); +typedef int (*crypt_func_send_menu_t) (HEADER *msg); /* (SMIME) */ typedef void (*crypt_func_smime_getkeys_t) (ENVELOPE *env); diff -r 9da67ea88f25 -r 4c7881c441e7 cryptglue.c --- a/cryptglue.c Sun Mar 26 12:27:15 2017 -0700 +++ b/cryptglue.c Mon Mar 27 11:46:26 2017 -0700 @@ -246,10 +246,10 @@ } -int crypt_pgp_send_menu (HEADER *msg, int *redraw) +int crypt_pgp_send_menu (HEADER *msg) { if (CRYPT_MOD_CALL_CHECK (PGP, send_menu)) - return (CRYPT_MOD_CALL (PGP, send_menu)) (msg, redraw); + return (CRYPT_MOD_CALL (PGP, send_menu)) (msg); return 0; } @@ -380,10 +380,10 @@ return -1; } -int crypt_smime_send_menu (HEADER *msg, int *redraw) +int crypt_smime_send_menu (HEADER *msg) { if (CRYPT_MOD_CALL_CHECK (SMIME, send_menu)) - return (CRYPT_MOD_CALL (SMIME, send_menu)) (msg, redraw); + return (CRYPT_MOD_CALL (SMIME, send_menu)) (msg); return 0; } diff -r 9da67ea88f25 -r 4c7881c441e7 curs_lib.c --- a/curs_lib.c Sun Mar 26 12:27:15 2017 -0700 +++ b/curs_lib.c Mon Mar 27 11:46:26 2017 -0700 @@ -94,7 +94,7 @@ { keypad (stdscr, TRUE); clearok (stdscr, TRUE); - set_option (OPTNEEDREDRAW); + mutt_set_current_menu_redraw (); } event_t mutt_getch (void) @@ -769,7 +769,6 @@ if (_mutt_get_field (pc, buf, blen, (buffy ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR, multiple, files, numfiles) != 0) buf[0] = 0; - MAYBE_REDRAW (*redraw); FREE (&pc); } diff -r 9da67ea88f25 -r 4c7881c441e7 curs_main.c --- a/curs_main.c Sun Mar 26 12:27:15 2017 -0700 +++ b/curs_main.c Mon Mar 27 11:46:26 2017 -0700 @@ -519,6 +519,7 @@ menu->color = index_color; menu->current = ci_first_message (); menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, IndexHelp); + mutt_push_current_menu (menu); if (!attach_msg) mutt_buffy_check(1); /* force the buffy check after we enter the folder */ @@ -612,14 +613,14 @@ if (op != -1) mutt_curs_set (0); - if (menu->redraw & REDRAW_FULL) - { - menu_redraw_full (menu); - mutt_show_error (); - } - if (menu->menu == MENU_MAIN) { + if (menu->redraw & REDRAW_FULL) + { + menu_redraw_full (menu); + mutt_show_error (); + } + #ifdef USE_SIDEBAR if (menu->redraw & REDRAW_SIDEBAR || SidebarNeedsRedraw) { @@ -1270,12 +1271,14 @@ mutt_sleep (0); - /* Set CurrentMenu to MENU_MAIN before executing any folder - * hooks so that all the index menu functions are available to - * the exec command. - */ - - CurrentMenu = MENU_MAIN; + /* Note that menu->menu may be MENU_PAGER if the change folder + * operation originated from the pager. + * + * However, exec commands currently use CurrentMenu to determine what + * functions are available, which is automatically set by the + * mutt_push/pop_current_menu() functions. If that changes, the menu + * would need to be reset here, and the pager cleanup code after the + * switch statement would need to be run. */ mutt_folder_hook (buf); if ((Context = mx_open_mailbox (buf, @@ -1322,12 +1325,21 @@ if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); - if ((op = mutt_display_message (CURHDR)) == -1) + + /* If we are returning to the pager via an index menu redirection, we + * need to reset the menu->menu. Otherwise mutt_pop_current_menu() will + * set CurrentMenu incorrectly when we return back to the index menu. */ + menu->menu = MENU_MAIN; + + if ((op = mutt_display_message (CURHDR)) == -1) { unset_option (OPTNEEDRESORT); break; } + /* This is used to redirect a single operation back here afterwards. If + * mutt_display_message() returns 0, then the menu and pager state will + * be cleaned up after this switch statement. */ menu->menu = MENU_PAGER; menu->oldcurrent = menu->current; continue; @@ -1948,20 +1960,18 @@ CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; - ci_bounce_message (tag ? NULL : CURHDR, &menu->redraw); + ci_bounce_message (tag ? NULL : CURHDR); break; case OP_CREATE_ALIAS: mutt_create_alias (Context && Context->vcount ? CURHDR->env : NULL, NULL); - MAYBE_REDRAW (menu->redraw); menu->redraw |= REDRAW_CURRENT; break; case OP_QUERY: CHECK_ATTACH; mutt_query_menu (NULL, 0); - MAYBE_REDRAW (menu->redraw); break; case OP_PURGE_MESSAGE: @@ -2041,7 +2051,6 @@ case OP_ENTER_COMMAND: - CurrentMenu = MENU_MAIN; mutt_enter_command (); mutt_check_rescore (Context); if (option (OPTFORCEREDRAWINDEX)) @@ -2181,7 +2190,6 @@ } #endif - MAYBE_REDRAW (menu->redraw); break; case OP_PRINT: @@ -2310,7 +2318,6 @@ case OP_SHELL_ESCAPE: mutt_shell_escape (); - MAYBE_REDRAW (menu->redraw); break; case OP_TAG_THREAD: @@ -2446,14 +2453,12 @@ mutt_clear_pager_position (); menu->menu = MENU_MAIN; menu->redraw = REDRAW_FULL; -#if 0 - set_option (OPTWEED); /* turn header weeding back on. */ -#endif } if (done) break; } + mutt_pop_current_menu (menu); mutt_menuDestroy (&menu); return (close); } diff -r 9da67ea88f25 -r 4c7881c441e7 doc/makedoc-defs.h --- a/doc/makedoc-defs.h Sun Mar 26 12:27:15 2017 -0700 +++ b/doc/makedoc-defs.h Mon Mar 27 11:46:26 2017 -0700 @@ -19,6 +19,9 @@ # ifndef USE_SSL_OPENSSL # define USE_SSL_OPENSSL # endif +# ifndef HAVE_SSL_PARTIAL_CHAIN +# define HAVE_SSL_PARTIAL_CHAIN +# endif # ifndef USE_SSL_GNUTLS # define USE_SSL_GNUTLS # endif diff -r 9da67ea88f25 -r 4c7881c441e7 enter.c --- a/enter.c Sun Mar 26 12:27:15 2017 -0700 +++ b/enter.c Mon Mar 27 11:46:26 2017 -0700 @@ -532,7 +532,6 @@ !memcmp (tempbuf, state->wbuf + i, (state->lastchar - i) * sizeof (wchar_t))) { mutt_select_file (buf, buflen, (flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0); - set_option (OPTNEEDREDRAW); if (*buf) replace_part (state, i, buf); rv = 1; @@ -643,7 +642,6 @@ _mutt_select_file (buf, buflen, ((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | (multiple ? MUTT_SEL_MULTI : 0), files, numfiles); - set_option (OPTNEEDREDRAW); if (*buf) { mutt_pretty_mailbox (buf, buflen); diff -r 9da67ea88f25 -r 4c7881c441e7 init.c --- a/init.c Sun Mar 26 12:27:15 2017 -0700 +++ b/init.c Mon Mar 27 11:46:26 2017 -0700 @@ -941,6 +941,46 @@ return 0; } +static int parse_path_list (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) +{ + char path[_POSIX_PATH_MAX]; + + do + { + mutt_extract_token (buf, s, 0); + strfcpy (path, buf->data, sizeof (path)); + mutt_expand_path (path, sizeof (path)); + add_to_list ((LIST **) data, path); + } + while (MoreArgs (s)); + + return 0; +} + +static int parse_path_unlist (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) +{ + char path[_POSIX_PATH_MAX]; + + do + { + mutt_extract_token (buf, s, 0); + /* + * Check for deletion of entire list + */ + if (mutt_strcmp (buf->data, "*") == 0) + { + mutt_free_list ((LIST **) data); + break; + } + strfcpy (path, buf->data, sizeof (path)); + mutt_expand_path (path, sizeof (path)); + remove_from_list ((LIST **) data, path); + } + while (MoreArgs (s)); + + return 0; +} + static int parse_lists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { group_context_t *gc = NULL; diff -r 9da67ea88f25 -r 4c7881c441e7 init.h --- a/init.h Sun Mar 26 12:27:15 2017 -0700 +++ b/init.h Mon Mar 27 11:46:26 2017 -0700 @@ -78,7 +78,6 @@ }; #define UL (unsigned long) - #endif /* _MAKEDOC */ #ifndef ISPELL @@ -3377,6 +3376,24 @@ ** URL. You should only unset this for particular known hosts, using ** the \fC$<account-hook>\fP function. */ +# ifdef USE_SSL_OPENSSL +# ifdef HAVE_SSL_PARTIAL_CHAIN + { "ssl_verify_partial_chains", DT_BOOL, R_NONE, OPTSSLVERIFYPARTIAL, 0 }, + /* + ** .pp + ** This option should not be changed from the default unless you understand + ** what you are doing. + ** .pp + ** Setting this variable to \fIyes\fP will permit verifying partial + ** certification chains, i. e. a certificate chain where not the root, + ** but an intermediate certificate CA, or the host certificate, are + ** marked trusted (in $$certificate_file), without marking the root + ** signing CA as trusted. + ** .pp + ** (OpenSSL 1.0.2b and newer only). + */ +# endif /* defined HAVE_SSL_PARTIAL_CHAIN */ +# endif /* defined USE_SSL_OPENSSL */ { "ssl_ciphers", DT_STR, R_NONE, UL &SslCiphers, UL 0 }, /* ** .pp @@ -3880,6 +3897,8 @@ static int parse_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_spam_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_unlist (BUFFER *, BUFFER *, unsigned long, BUFFER *); +static int parse_path_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); +static int parse_path_unlist (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_group (BUFFER *, BUFFER *, unsigned long, BUFFER *); @@ -3975,8 +3994,8 @@ { "set", parse_set, 0 }, { "setenv", parse_setenv, 0 }, #ifdef USE_SIDEBAR - { "sidebar_whitelist",parse_list, UL &SidebarWhitelist }, - { "unsidebar_whitelist",parse_unlist, UL &SidebarWhitelist }, + { "sidebar_whitelist",parse_path_list, UL &SidebarWhitelist }, + { "unsidebar_whitelist",parse_path_unlist, UL &SidebarWhitelist }, #endif { "source", parse_source, 0 }, { "spam", parse_spam_list, MUTT_SPAM }, diff -r 9da67ea88f25 -r 4c7881c441e7 main.c --- a/main.c Sun Mar 26 12:27:15 2017 -0700 +++ b/main.c Mon Mar 27 11:46:26 2017 -0700 @@ -163,9 +163,9 @@ exit (0); } -extern const char cc_version[]; -extern const char cc_cflags[]; -extern const char configure_options[]; +extern unsigned char cc_version[]; +extern unsigned char cc_cflags[]; +extern unsigned char configure_options[]; static char * rstrip_in_place(char *s) @@ -222,13 +222,13 @@ puts ("\n\nCompiler:"); rstrip_in_place((char *)cc_version); - puts (cc_version); + puts ((char *)cc_version); rstrip_in_place((char *)configure_options); - printf ("\nConfigure options: %s\n", configure_options); + printf ("\nConfigure options: %s\n", (char *)configure_options); rstrip_in_place((char *)cc_cflags); - printf ("\nCompilation CFLAGS: %s\n", cc_cflags); + printf ("\nCompilation CFLAGS: %s\n", (char *)cc_cflags); puts (_("\nCompile options:")); diff -r 9da67ea88f25 -r 4c7881c441e7 menu.c --- a/menu.c Sun Mar 26 12:27:15 2017 -0700 +++ b/menu.c Mon Mar 27 11:46:26 2017 -0700 @@ -30,6 +30,11 @@ char* SearchBuffers[MENU_MAX]; +/* These are used to track the active menus, for redraw operations. */ +static size_t MenuStackCount = 0; +static size_t MenuStackLen = 0; +static MUTTMENU **MenuStack = NULL; + static void print_enriched_string (int attr, unsigned char *s, int do_color) { wchar_t wc; @@ -389,7 +394,7 @@ if (menu->top != 0) { menu->top = 0; - set_option (OPTNEEDREDRAW); + menu->redraw |= REDRAW_INDEX; } } else @@ -709,6 +714,7 @@ p->messagewin = MuttMessageWindow; p->color = default_color; p->search = menu_search_generic; + return (p); } @@ -727,6 +733,57 @@ FREE (p); /* __FREE_CHECKED__ */ } +static MUTTMENU *get_current_menu (void) +{ + return MenuStackCount ? MenuStack[MenuStackCount - 1] : NULL; +} + +void mutt_push_current_menu (MUTTMENU *menu) +{ + if (MenuStackCount >= MenuStackLen) + { + MenuStackLen += 5; + safe_realloc (&MenuStack, MenuStackLen * sizeof(MUTTMENU *)); + } + + MenuStack[MenuStackCount++] = menu; + CurrentMenu = menu->menu; +} + +void mutt_pop_current_menu (MUTTMENU *menu) +{ + MUTTMENU *prev_menu; + + if (!MenuStackCount || + (MenuStack[MenuStackCount - 1] != menu)) + { + dprint (1, (debugfile, "mutt_pop_current_menu() called with inactive menu\n")); + return; + } + + MenuStackCount--; + prev_menu = get_current_menu (); + if (prev_menu) + { + CurrentMenu = prev_menu->menu; + prev_menu->redraw = REDRAW_FULL; + } + else + { + CurrentMenu = MENU_MAIN; + } +} + +void mutt_set_current_menu_redraw (void) +{