|
|
a800e3 |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
a800e3 |
index a9b245d..c7f184d 100644
|
|
|
a800e3 |
--- a/src/Makefile.am
|
|
|
a800e3 |
+++ b/src/Makefile.am
|
|
|
a800e3 |
@@ -17,10 +17,10 @@ MINGWLIBS = -lgnurx -lshlwapi
|
|
|
a800e3 |
else
|
|
|
a800e3 |
MINGWLIBS =
|
|
|
a800e3 |
endif
|
|
|
a800e3 |
-libmagic_la_LIBADD = $(LTLIBOBJS) $(MINGWLIBS)
|
|
|
a800e3 |
+libmagic_la_LIBADD = -lm $(LTLIBOBJS) $(MINGWLIBS)
|
|
|
a800e3 |
|
|
|
a800e3 |
file_SOURCES = file.c seccomp.c
|
|
|
a800e3 |
-file_LDADD = libmagic.la
|
|
|
a800e3 |
+file_LDADD = libmagic.la -lm
|
|
|
a800e3 |
CLEANFILES = magic.h
|
|
|
a800e3 |
EXTRA_DIST = magic.h.in
|
|
|
a800e3 |
HDR= $(top_srcdir)/src/magic.h.in
|
|
|
a800e3 |
diff --git a/src/softmagic.c b/src/softmagic.c
|
|
|
a800e3 |
index 3e76517..57b4677 100644
|
|
|
a800e3 |
--- a/src/softmagic.c
|
|
|
a800e3 |
+++ b/src/softmagic.c
|
|
|
a800e3 |
@@ -37,6 +37,7 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.259 2018/03/11 01:23:52 christos Exp $")
|
|
|
a800e3 |
|
|
|
a800e3 |
#include "magic.h"
|
|
|
a800e3 |
#include <assert.h>
|
|
|
a800e3 |
+#include <math.h>
|
|
|
a800e3 |
#include <string.h>
|
|
|
a800e3 |
#include <ctype.h>
|
|
|
a800e3 |
#include <stdlib.h>
|
|
|
a800e3 |
@@ -1893,19 +1894,19 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '!':
|
|
|
a800e3 |
- matched = fv != fl;
|
|
|
a800e3 |
+ matched = isunordered(fl, fv) ? 1 : fv != fl;
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '=':
|
|
|
a800e3 |
- matched = fv == fl;
|
|
|
a800e3 |
+ matched = isunordered(fl, fv) ? 0 : fv == fl;
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '>':
|
|
|
a800e3 |
- matched = fv > fl;
|
|
|
a800e3 |
+ matched = isgreater(fv, fl);
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '<':
|
|
|
a800e3 |
- matched = fv < fl;
|
|
|
a800e3 |
+ matched = isless(fv, fl);
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
default:
|
|
|
a800e3 |
@@ -1926,19 +1927,19 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '!':
|
|
|
a800e3 |
- matched = dv != dl;
|
|
|
a800e3 |
+ matched = isunordered(dv, dl) ? 1 : dv != dl;
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '=':
|
|
|
a800e3 |
- matched = dv == dl;
|
|
|
a800e3 |
+ matched = isunordered(dv, dl) ? 0 : dv == dl;
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '>':
|
|
|
a800e3 |
- matched = dv > dl;
|
|
|
a800e3 |
+ matched = isgreater(dv, dl);
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
case '<':
|
|
|
a800e3 |
- matched = dv < dl;
|
|
|
a800e3 |
+ matched = isless(dv, dl);
|
|
|
a800e3 |
break;
|
|
|
a800e3 |
|
|
|
a800e3 |
default:
|