From 6372536069ce7c6eb0154dc2d673bfd5fea990a4 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 23 Sep 2017 21:15:53 +0200 Subject: [PATCH] Update files for file-5.32 import. --- contrib/file/src/softmagic.c | 2 +- lib/libmagic/Makefile | 18 +++++++++++++----- lib/libmagic/config.h | 26 ++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/contrib/file/src/softmagic.c b/contrib/file/src/softmagic.c index b9e975374b..9925219b70 100644 --- a/contrib/file/src/softmagic.c +++ b/contrib/file/src/softmagic.c @@ -1300,7 +1300,7 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, private uint32_t do_ops(struct magic *m, intmax_t lhs, intmax_t off) { - intmax_t offset; + intmax_t offset = 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { case FILE_OPAND: diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index 66b69c1928..d25884f088 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -2,6 +2,7 @@ CONTRIBDIR= ${.CURDIR}/../../contrib/file/src MAGICDIR= ${CONTRIBDIR}/../magic .PATH: ${CONTRIBDIR} +VER!= grep -w VERSION ${.CURDIR}/config.h | awk -F\" '{print $$2}' MAGIC= ${FILESDIR}/magic LIB= magic @@ -11,7 +12,7 @@ DPADD= ${LIBZ} LDADD= -lz SRCS= apprentice.c ascmagic.c cdf.c cdf_time.c \ - compress.c encoding.c fsmagic.c funcs.c \ + compress.c der.c encoding.c fsmagic.c funcs.c \ is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c INCS= magic.h @@ -19,7 +20,7 @@ INCS= magic.h #SRCS+= apptype.c CFLAGS+= -DHAVE_CONFIG_H -DMAGIC=\"${MAGIC}\" -CFLAGS+= -I${.CURDIR} -I${CONTRIBDIR} +CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${CONTRIBDIR} MAN= libmagic.3 @@ -30,6 +31,7 @@ MLINKS+= libmagic.3 magic_errno.3 MLINKS+= libmagic.3 magic_descriptor.3 MLINKS+= libmagic.3 magic_file.3 MLINKS+= libmagic.3 magic_buffer.3 +MLINKS+= libmagic.3 magic_getflags.3 MLINKS+= libmagic.3 magic_setflags.3 MLINKS+= libmagic.3 magic_check.3 MLINKS+= libmagic.3 magic_compile.3 @@ -45,7 +47,7 @@ CLEANFILES+= magic magic.mgc libmagic.3 FILES= magic magic.mgc FILESDIR= ${SHAREDIR}/misc -MAGFILES= ${MAGICDIR}/Header ${MAGICDIR}/Localstuff\ +MAGFILES= ${MAGICDIR}/Header ${MAGICDIR}/Localstuff \ ${MAGICDIR}/Magdir/[a-z]* libmagic.3: ${CONTRIBDIR}/../doc/libmagic.man @@ -63,7 +65,13 @@ CLEANFILES+= mkmagic.nx build-tools: mkmagic.nx 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} +mkmagic.nx: apprentice.c encoding.c cdf_time.c funcs.c magic.c print.c ${INCS} + ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${.ALLSRC:N*.h} ${NXLDLIBS} -o ${.TARGET} + +CLEANFILES+= ${INCS} +.for inc in ${INCS} +${inc}: ${inc}.in + sed -e 's,X.YY,${VER:S,",,g:S,.,,g},g' ${.ALLSRC} > ${.TARGET} +.endfor .include diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 0b84672c11..82c4cbade2 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -33,6 +33,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 +/* Define to 1 if you have the `dprintf' function. */ +#define HAVE_DPRINTF 1 + /* Define to 1 if you have the header file. */ #define HAVE_ERR_H 1 @@ -63,6 +66,9 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + /* Define to 1 if the system has the type `intptr_t'. */ #define HAVE_INTPTR_T 1 @@ -81,6 +87,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #define HAVE_MBRTOWC 1 @@ -91,7 +100,7 @@ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkostemp' function. */ -/* #undef HAVE_MKOSTEMP */ +#define HAVE_MKOSTEMP 1 /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 @@ -108,6 +117,12 @@ /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Have sig_t type */ +#define HAVE_SIG_T 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDDEF_H 1 @@ -260,7 +275,7 @@ #define PACKAGE_NAME "file" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "file 5.22" +#define PACKAGE_STRING "file 5.32" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "file" @@ -269,7 +284,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "5.22" +#define PACKAGE_VERSION "5.32" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -300,7 +315,7 @@ /* Version number of package */ -#define VERSION "5.22" +#define VERSION "5.32" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -314,6 +329,9 @@ # endif #endif +/* Enable zlib compression support */ +#define ZLIBSUPPORT 1 + /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 -- 2.11.4.GIT