From 8e7a606a9e3de3a0f270f6a81d1dc14753abf5e1 Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Sun, 25 Jun 2017 23:47:11 +0100 Subject: [PATCH] revert part of 40f81d1 Add debug_level/debug_file options This patch moves the set_default/restore_default couple after the defaults have been set by the init function; this was correctly placed in 1.7.2 and somehow it got moved to the wrong place, which means that tmpdir (and many other variable) are not correctly set with their new default value determined from environment variables (or other logic), so when they get resetted with a 'reset all' call in .muttrc, they will never have the correct default to fall back to and they will use the wrong one in init.h This patch fixes: - http://bugs.debian.org/865822 - http://bugs.debian.org/865842 Issue #654 --- init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init.c b/init.c index 293f2746c..d23c5dc5a 100644 --- a/init.c +++ b/init.c @@ -3989,13 +3989,6 @@ void mutt_init(int skip_sys_rc, struct List *commands) Shell = safe_strdup((p = getenv("SHELL")) ? p : "/bin/sh"); } - /* Set standard defaults */ - for (int i = 0; MuttVars[i].option; i++) - { - set_default(&MuttVars[i]); - restore_default(&MuttVars[i]); - } - #ifdef DEBUG /* Start up debugging mode if requested from cmdline */ if (debuglevel_cmdline > 0) @@ -4134,6 +4127,13 @@ void mutt_init(int skip_sys_rc, struct List *commands) Matches = safe_calloc(Matches_listsize, sizeof(char *)); + /* Set standard defaults */ + for (int i = 0; MuttVars[i].option; i++) + { + set_default(&MuttVars[i]); + restore_default(&MuttVars[i]); + } + CurrentMenu = MENU_MAIN; -- 2.49.0