]> granicus.if.org Git - file/commitdiff
allow text overrides from Jan Kaluza
authorChristos Zoulas <christos@zoulas.com>
Thu, 7 Oct 2010 00:33:20 +0000 (00:33 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 7 Oct 2010 00:33:20 +0000 (00:33 +0000)
src/apprentice.c

index 960d0ec956628554f8cc23c8509d9736d2e56de4..40d547bc6cf15a0a8a16c08d3fa72e350e835427 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.159 2010/07/21 16:47:17 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.160 2010/09/20 14:14:49 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -632,8 +632,11 @@ set_test_type(struct magic *mstart, struct magic *m)
        case FILE_PSTRING:
        case FILE_BESTRING16:
        case FILE_LESTRING16:
-               /* binary test, set flag */
-               mstart->flag |= BINTEST;
+               /* Allow text overrides */
+               if (mstart->str_flags & STRING_TEXTTEST)
+                       mstart->flag |= TEXTTEST;
+               else
+                       mstart->flag |= BINTEST;
                break;
        case FILE_REGEX:
        case FILE_SEARCH: