Merge branch 'vendor/FILE'
[dragonfly.git] / contrib / file / src / apprentice.c
index 7400c57..c180e68 100644 (file)
@@ -947,7 +947,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)
@@ -962,6 +962,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
@@ -2341,7 +2342,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);