Commit e81a43fa authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Stopping the search when a magic matched.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4886 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 3 additions and 0 deletions
+3 -0
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* src/color.c (color_update): Open the magic database only when * src/color.c (color_update): Open the magic database only when
actually going to use it, and close it afterward. actually going to use it, and close it afterward.
* doc/syntax/{perl.nanorc,xml.nanorc}: Improve two magic regexes. * doc/syntax/{perl.nanorc,xml.nanorc}: Improve two magic regexes.
* src/color.c (color_update): Stop seeking when a magic matched.
2014-05-13 Benno Schulenberg <bensberg@justemail.net> 2014-05-13 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_linter): Make an error message somewhat clearer. * src/text.c (do_linter): Make an error message somewhat clearer.
......
...@@ -310,6 +310,8 @@ void color_update(void) ...@@ -310,6 +310,8 @@ void color_update(void)
if (not_compiled) if (not_compiled)
nfreeregex(&e->ext); nfreeregex(&e->ext);
} }
if (openfile->syntax)
break;
} }
if (stat(openfile->filename, &fileinfo) == 0) if (stat(openfile->filename, &fileinfo) == 0)
magic_close(cookie); magic_close(cookie);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment