diff --git a/ChangeLog b/ChangeLog index 60b8dd54f8ee0931866e73a798e598e060a3c224..d9dcaf70f58a89748d12682986604ee1b49e6820 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 00af4b7770706d51ec9bb61bf080b1863197902f..7d130b9e86d1873d41f4c277ba3da3c371ba3f9a 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