Correct a regression introduced during the import of file(1) 5.11.

Magic tests containing "search" or "regex" directives were incorrectly
compiled by "mkmagic" and were effectively ignored.  This caused troff
files (for example) to be detected as simply "ASCII text" instead of
as "troff or preprocessor input, ASCII text".

PR:		bin/170415
Approved by:	consensus on developers@
MFC after:	3 days
This commit is contained in:
Stephen McKay 2012-08-17 02:27:17 +00:00
parent d65f1abca7
commit a0ebde2020
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239348
2 changed files with 1 additions and 3 deletions

View File

@ -648,7 +648,6 @@ set_test_type(struct magic *mstart, struct magic *m)
break;
case FILE_REGEX:
case FILE_SEARCH:
#ifndef COMPILE_ONLY
/* Check for override */
if (mstart->str_flags & STRING_BINTEST)
mstart->flag |= BINTEST;
@ -664,7 +663,6 @@ set_test_type(struct magic *mstart, struct magic *m)
mstart->flag |= BINTEST;
else
mstart->flag |= TEXTTEST;
#endif
break;
case FILE_DEFAULT:
/* can't deduce anything; we shouldn't see this at the

View File

@ -39,7 +39,7 @@ magic.mgc: mkmagic magic
CLEANFILES+= mkmagic
build-tools: mkmagic
mkmagic: apprentice.c funcs.c getline.c magic.c print.c
mkmagic: apprentice.c encoding.c funcs.c getline.c magic.c print.c
${CC} ${CFLAGS} -DCOMPILE_ONLY -DHOSTPROG ${LDFLAGS} \
-o ${.TARGET} ${.ALLSRC}