Merge branch 'vendor/FILE'
[dragonfly.git] / contrib / file / src / apprentice.c
index 58826c3..fdf4b2f 100644 (file)
@@ -592,7 +592,7 @@ set_test_type(struct magic *mstart, struct magic *m)
                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)
@@ -607,6 +607,7 @@ 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
@@ -1806,7 +1807,7 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
        case FILE_LEFLOAT:
                if (m->reln != 'x') {
                        char *ep;
-#ifdef HAVE_STRTOF
+#if defined(HAVE_STRTOF) && !defined(COMPILE_ONLY)
                        m->value.f = strtof(*p, &ep);
 #else
                        m->value.f = (float)strtod(*p, &ep);