]> granicus.if.org Git - neomutt/commitdiff
revert part of 40f81d1 Add debug_level/debug_file options
authorAntonio Radici <antonio@dyne.org>
Sun, 25 Jun 2017 22:47:11 +0000 (23:47 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 25 Jun 2017 23:24:21 +0000 (00:24 +0100)
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

diff --git a/init.c b/init.c
index 293f2746c45ef6fc23d8c748956e92ac3dd5fa3c..d23c5dc5a15386ac889c85d27af528ddc2755e2c 100644 (file)
--- 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;