From: Franco Fichtner Date: Thu, 19 Jun 2014 12:10:26 +0000 (+0200) Subject: libmagic: fix file identification X-Git-Tag: v4.1.0~577 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/0cc76476de497fc3ffd7cdf6439d8e116132a7a5 libmagic: fix file identification Removes local modifications from contrib code and fixes at least the following identification issue. Before: # file /usr/src/bin/test/test.c /usr/src/bin/test/test.c: ASCII text After: # file /usr/src/bin/test/test.c /usr/src/bin/test/test.c: C source, ASCII text --- diff --git a/contrib/file/src/apprentice.c b/contrib/file/src/apprentice.c index c180e68a22..7400c57185 100644 --- a/contrib/file/src/apprentice.c +++ b/contrib/file/src/apprentice.c @@ -947,7 +947,7 @@ 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; if (mstart->str_flags & STRING_TEXTTEST) @@ -962,7 +962,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 @@ -2342,7 +2341,7 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) case FILE_LEFLOAT: if (m->reln != 'x') { char *ep; -#if defined(HAVE_STRTOF) && !defined(COMPILE_ONLY) +#ifdef HAVE_STRTOF m->value.f = strtof(*p, &ep); #else m->value.f = (float)strtod(*p, &ep); diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index b44facab8b..4f6ba3376f 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -56,8 +56,8 @@ magic.mgc: mkmagic.nx magic CLEANFILES+= mkmagic.nx build-tools: mkmagic.nx -NXCFLAGS+= -w -DCOMPILE_ONLY -DBOOTSTRAPPING -mkmagic.nx: apprentice.c cdf_time.c funcs.c magic.c print.c +NXCFLAGS+= -w -DCOMPILE_ONLY +mkmagic.nx: apprentice.c encoding.c cdf_time.c funcs.c magic.c print.c ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC} ${NXLDLIBS} -o ${.TARGET} .include diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 4f46588aa1..010a572393 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -199,7 +199,6 @@ declarations. */ #define HAVE_VISIBILITY 1 -#ifndef BOOTSTRAPPING /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 @@ -208,7 +207,6 @@ /* Define to 1 if you have the `wcwidth' function. */ #define HAVE_WCWIDTH 1 -#endif /* BOOTSTRAPPING */ /* Define to 1 if `fork' works. */ #define HAVE_WORKING_FORK 1