Merge branch 'vendor/FILE'
authorJan Lentfer <Jan.Lentfer@web.de>
Mon, 25 Jan 2010 20:11:28 +0000 (21:11 +0100)
committerJan Lentfer <Jan.Lentfer@web.de>
Mon, 25 Jan 2010 20:11:28 +0000 (21:11 +0100)
1  2 
contrib/file/src/apprentice.c

@@@ -594,12 -592,21 +592,22 @@@ set_test_type(struct magic *mstart, str
                break;
        case FILE_REGEX:
        case FILE_SEARCH:
 -              /* Check for override */
 +#ifndef COMPILE_ONLY
+               if (mstart->str_flags & STRING_BINTEST)
+                       mstart->flag |= BINTEST;
+               if (mstart->str_flags & STRING_TEXTTEST)
+                       mstart->flag |= TEXTTEST;
+                   
+               if (mstart->flag & (TEXTTEST|BINTEST))
+                       break;
                /* binary test if pattern is not text */
                if (file_looks_utf8(m->value.us, (size_t)m->vallen, NULL,
                    NULL) <= 0)
                        mstart->flag |= BINTEST;
+               else
+                       mstart->flag |= TEXTTEST;
 +#endif
                break;
        case FILE_DEFAULT:
                /* can't deduce anything; we shouldn't see this at the