]> granicus.if.org Git - neomutt/commitdiff
refactor nntp setup
authorRichard Russon <rich@flatcap.org>
Thu, 24 Aug 2017 19:52:11 +0000 (20:52 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 1 Sep 2017 12:45:52 +0000 (13:45 +0100)
Reorder the code so that NewsServer is only set once.

init.c

diff --git a/init.c b/init.c
index ea78262469603926d6779fd8a1e2836c4c931cb4..546340efb185038213695aa1bc920f50e272d071 100644 (file)
--- a/init.c
+++ b/init.c
@@ -4218,6 +4218,12 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
 #endif
 
 #ifdef USE_NNTP
+  if ((p = getenv("NNTPSERVER")))
+  {
+    FREE(&NewsServer);
+    NewsServer = safe_strdup(p);
+  }
+  else
   {
     FILE *f = NULL;
     char *c = NULL;
@@ -4236,11 +4242,6 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
       fclose(f);
     }
   }
-  if ((p = getenv("NNTPSERVER")))
-  {
-    FREE(&NewsServer);
-    NewsServer = safe_strdup(p);
-  }
 #endif
 
   if ((p = getenv("MAIL")))