From: Christos Zoulas Date: Thu, 7 Oct 2010 00:33:20 +0000 (+0000) Subject: allow text overrides from Jan Kaluza X-Git-Tag: FILE5_07~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28e2e1ae5ff2396f8d979be1523ad8cec47e53f6;p=file allow text overrides from Jan Kaluza --- diff --git a/src/apprentice.c b/src/apprentice.c index 960d0ec9..40d547bc 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -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: