]> git.wh0rd.org Git - nano.git/commitdiff
Stopping the search when a magic matched.
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 14 May 2014 11:51:26 +0000 (11:51 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 14 May 2014 11:51:26 +0000 (11:51 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4886 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/color.c

index 10d2b5d185b1a25c675be79b978ce626a9e0e315..3c87289bb525c676fb0f22580b334ce9adc8e4f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
        * src/color.c (color_update): Open the magic database only when
        actually going to use it, and close it afterward.
        * 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>
        * src/text.c (do_linter): Make an error message somewhat clearer.
index ee8312105c4f18cd1f689241883b2d77dd70f8d5..6e807c425492ad039e671ee4e44ede103bc983cb 100644 (file)
@@ -310,6 +310,8 @@ void color_update(void)
                    if (not_compiled)
                        nfreeregex(&e->ext);
                }
+               if (openfile->syntax)
+                   break;
            }
            if (stat(openfile->filename, &fileinfo) == 0)
                magic_close(cookie);