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.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5037 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-06-30 17:47:07 +00:00
parent 09dd0a4acb
commit e94a00a26c
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-06-30 Benno Schulenberg <bensberg@justemail.net>
* 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.
2014-06-29 Benno Schulenberg <bensberg@justemail.net> 2014-06-29 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c: Fix compilation with --enable-tiny --enable-nanorc. * src/rcfile.c: Fix compilation with --enable-tiny --enable-nanorc.
* src/winio.c (parse_kbinput, get_escape_seq_kbinput): Make Ctrl-Left * src/winio.c (parse_kbinput, get_escape_seq_kbinput): Make Ctrl-Left

View File

@ -167,6 +167,10 @@ void color_update(void)
openfile->syntax = NULL; openfile->syntax = NULL;
openfile->colorstrings = NULL; openfile->colorstrings = NULL;
/* If the rcfiles were not read, or contained no syntaxes, get out. */
if (syntaxes == NULL)
return;
/* If we specified a syntax override string, use it. */ /* If we specified a syntax override string, use it. */
if (syntaxstr != NULL) { if (syntaxstr != NULL) {
/* If the syntax override is "none", it's the same as not having /* If the syntax override is "none", it's the same as not having