commit eaf235f1e63fad9421127575424b2b7b264651b3
parent e94a00a26c0ec4c89b24fcc2ac6a0f5ad081fb19
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Mon, 30 Jun 2014 17:49:53 +0000
Moving some variables to a better place.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5038 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git 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
@@ -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