From eaf235f1e63fad9421127575424b2b7b264651b3 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Mon, 30 Jun 2014 17:49:53 +0000
Subject: [PATCH] Moving some variables to a better place.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5038 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  1 +
 src/color.c | 10 +++-------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 60b8dd54..d9dcaf70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 	* src/color.c (color_update): When there are no syntaxes, for example
 	with --ignorercfiles, do not try to find one, because that would lead
 	to the magic database being searched, which slows down startup a lot.
+	* src/color.c (color_update): Move some variables to a better place.
 
 2014-06-29  Benno Schulenberg  <bensberg@justemail.net>
 	* src/rcfile.c: Fix compilation with --enable-tiny --enable-nanorc.
diff --git a/src/color.c b/src/color.c
index 00af4b77..7d130b9e 100644
--- a/src/color.c
+++ b/src/color.c
@@ -155,13 +155,6 @@ void color_update(void)
     colortype *tmpcolor, *defcolor = NULL;
     regexlisttype *e;
 
-/* Var magicstring will stay NULL if we fail to get a magic result. */
-#ifdef HAVE_LIBMAGIC
-    const char *magicstring = NULL;
-    magic_t cookie = NULL;
-    struct stat fileinfo;
-#endif
-
     assert(openfile != NULL);
 
     openfile->syntax = NULL;
@@ -266,6 +259,9 @@ void color_update(void)
 #ifdef HAVE_LIBMAGIC
 	/* Check magic if we don't have an answer yet. */
 	if (openfile->colorstrings == NULL) {
+	    struct stat fileinfo;
+	    magic_t cookie = NULL;
+	    const char *magicstring = NULL;
 #ifdef DEBUG
 	    fprintf(stderr, "No result from headerline either, trying libmagic...\n");
 #endif
-- 
GitLab