- diff -ur libmagic.orig/apprentice.c libmagic/apprentice.c
+ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
---- libmagic.orig/apprentice.c 2019-02-20 03:35:27.000000000 +0100
-+++ libmagic/apprentice.c 2020-11-19 11:50:32.412674100 +0100
+--- libmagic.orig/apprentice.c 2020-05-09 20:57:15.000000000 +0200
- +++ libmagic/apprentice.c 2020-08-29 19:56:29.638061530 +0200
+++++ libmagic/apprentice.c 2020-11-07 14:41:13.543842900 +0100
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
m->str_range = swap4(m->str_range);
m->str_flags = swap4(m->str_flags);
}
- diff -ur libmagic.orig/ascmagic.c libmagic/ascmagic.c
+ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
---- libmagic.orig/ascmagic.c 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/ascmagic.c 2020-09-07 00:42:14.447562400 +0200
-@@ -96,7 +96,7 @@
+--- libmagic.orig/ascmagic.c 2020-06-15 02:01:01.000000000 +0200
- +++ libmagic/ascmagic.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/ascmagic.c 2020-11-07 14:41:13.543842900 +0100
+@@ -50,7 +50,7 @@
+ #define ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \
+ || (x) == 0x85 || (x) == '\f')
+
+-private unsigned char *encode_utf8(unsigned char *, size_t, unichar *, size_t);
++private unsigned char *encode_utf8(unsigned char *, size_t, unicodechar *, size_t);
+ private size_t trim_nuls(const unsigned char *, size_t);
+
+ /*
+@@ -69,7 +69,7 @@
+ protected int
+ file_ascmagic(struct magic_set *ms, const struct buffer *b, int text)
+ {
+- unichar *ubuf = NULL;
++ unicodechar *ubuf = NULL;
+ size_t ulen = 0;
+ int rv = 1;
+ struct buffer bb;
+@@ -95,14 +95,14 @@
rv = file_ascmagic_with_encoding(ms, &bb,
ubuf, ulen, code, type, text);
return rv;
}
- diff -ur libmagic.orig/buffer.c libmagic/buffer.c
+@@ -334,7 +335,7 @@
+ * after end of string, or NULL if an invalid character is found.
+ */
+ private unsigned char *
+-encode_utf8(unsigned char *buf, size_t len, unichar *ubuf, size_t ulen)
++encode_utf8(unsigned char *buf, size_t len, unicodechar *ubuf, size_t ulen)
+ {
+ size_t i;
+ unsigned char *end = buf + len;
---- libmagic.orig/buffer.c 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/buffer.c 2020-09-07 00:42:14.447562400 +0200
+ diff -u libmagic.orig/buffer.c libmagic/buffer.c
- +++ libmagic/buffer.c 2020-08-29 02:05:56.212049441 +0200
+--- libmagic.orig/buffer.c 2020-02-16 16:52:49.000000000 +0100
+++++ libmagic/buffer.c 2020-11-07 14:41:13.543842900 +0100
@@ -31,19 +31,23 @@
#endif /* lint */
+ FINFO_READ_FUNC(b->fd, b->ebuf, b->elen) != (ssize_t)b->elen)
+ {
+ efree(b->ebuf);
-+ b->ebuf = NULL;
+ b->ebuf = NULL;
goto out;
}
- diff -ur libmagic.orig/cdf.c libmagic/cdf.c
-
+ diff -u libmagic.orig/cdf.c libmagic/cdf.c
---- libmagic.orig/cdf.c 2019-02-20 03:35:27.000000000 +0100
-+++ libmagic/cdf.c 2020-09-07 00:42:14.447562400 +0200
+--- libmagic.orig/cdf.c 2019-09-30 17:42:50.000000000 +0200
- +++ libmagic/cdf.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/cdf.c 2020-11-07 14:41:13.559464400 +0100
@@ -43,7 +43,17 @@
#include <err.h>
#endif
}
#endif
- diff -ur libmagic.orig/cdf.h libmagic/cdf.h
+ diff -u libmagic.orig/cdf.h libmagic/cdf.h
---- libmagic.orig/cdf.h 2019-02-20 02:24:19.000000000 +0100
-+++ libmagic/cdf.h 2020-09-07 00:42:14.447562400 +0200
+--- libmagic.orig/cdf.h 2019-09-30 17:42:50.000000000 +0200
- +++ libmagic/cdf.h 2020-07-04 12:40:36.663619335 +0200
+++++ libmagic/cdf.h 2020-10-09 14:15:33.483358900 +0200
@@ -35,10 +35,10 @@
#ifndef _H_CDF_
#define _H_CDF_
#endif
#ifdef __DJGPP__
#define timespec timeval
- diff -ur libmagic.orig/cdf_time.c libmagic/cdf_time.c
-@@ -48,6 +48,7 @@
- typedef int32_t cdf_secid_t;
-
- #define CDF_LOOP_LIMIT 10000
-+#define CDF_ELEMENT_LIMIT 100000
-
- #define CDF_SECID_NULL 0
- #define CDF_SECID_FREE -1
+ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2019-03-12 21:43:05.000000000 +0100
- +++ libmagic/cdf_time.c 2020-07-04 12:40:36.667619309 +0200
-+++ libmagic/cdf_time.c 2020-09-07 00:42:14.447562400 +0200
+++++ libmagic/cdf_time.c 2020-10-09 14:15:33.484360000 +0200
@@ -23,6 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
if (ptr != NULL)
return buf;
(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
- diff -ur libmagic.orig/compress.c libmagic/compress.c
+ diff -u libmagic.orig/compress.c libmagic/compress.c
---- libmagic.orig/compress.c 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/compress.c 2020-09-07 00:42:14.447562400 +0200
-@@ -45,13 +45,11 @@
- #endif
- #include <string.h>
- #include <errno.h>
--#include <ctype.h>
--#include <stdarg.h>
- #include <signal.h>
+--- libmagic.orig/compress.c 2020-05-31 02:11:06.000000000 +0200
- +++ libmagic/compress.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/compress.c 2020-11-07 14:41:13.559464400 +0100
+@@ -51,7 +51,7 @@
#ifndef HAVE_SIG_T
typedef void (*sig_t)(int);
#endif /* HAVE_SIG_T */
}
#endif
+#endif
- diff -ur libmagic.orig/der.c libmagic/der.c
+ diff -u libmagic.orig/der.c libmagic/der.c
---- libmagic.orig/der.c 2019-02-20 03:35:27.000000000 +0100
-+++ libmagic/der.c 2020-09-07 00:42:14.447562400 +0200
-@@ -51,7 +51,9 @@
+--- libmagic.orig/der.c 2020-06-15 02:01:01.000000000 +0200
- +++ libmagic/der.c 2020-08-29 11:56:12.303522747 +0200
+++++ libmagic/der.c 2020-11-07 14:41:13.559464400 +0100
+@@ -54,7 +54,9 @@
#include "magic.h"
#include "der.h"
#else
#include <sys/stat.h>
#include <err.h>
#endif
- diff -ur libmagic.orig/elfclass.h libmagic/elfclass.h
-@@ -218,6 +220,7 @@
- static int
- der_data(char *buf, size_t blen, uint32_t tag, const void *q, uint32_t len)
- {
-+ uint32_t i = 0;
- const uint8_t *d = CAST(const uint8_t *, q);
- switch (tag) {
- case DER_TAG_PRINTABLE_STRING:
-@@ -229,7 +232,7 @@
- break;
- }
-
-- for (uint32_t i = 0; i < len; i++) {
-+ for (; i < len; i++) {
- uint32_t z = i << 1;
- if (z < blen - 2)
- snprintf(buf + z, blen - z, "%.2x", d[i]);
+ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
--- libmagic.orig/elfclass.h 2019-02-20 02:30:19.000000000 +0100
- +++ libmagic/elfclass.h 2020-07-04 12:40:36.667619309 +0200
-+++ libmagic/elfclass.h 2020-09-07 00:42:14.447562400 +0200
+++++ libmagic/elfclass.h 2020-10-09 14:15:33.488358700 +0200
@@ -41,7 +41,7 @@
return toomany(ms, "program headers", phnum);
flags |= FLAGS_IS_CORE;
CAST(size_t, elf_getu16(swap, elfhdr.e_shentsize)),
fsize, elf_getu16(swap, elfhdr.e_machine),
CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
- diff -ur libmagic.orig/encoding.c libmagic/encoding.c
+ diff -u libmagic.orig/encoding.c libmagic/encoding.c
---- libmagic.orig/encoding.c 2019-04-15 18:48:41.000000000 +0200
-+++ libmagic/encoding.c 2020-09-07 00:42:14.447562400 +0200
-@@ -89,13 +89,13 @@
+--- libmagic.orig/encoding.c 2019-06-10 23:34:41.000000000 +0200
- +++ libmagic/encoding.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/encoding.c 2020-11-07 14:41:13.559464400 +0100
+@@ -43,14 +43,14 @@
+ #include <stdlib.h>
+
+
+-private int looks_ascii(const unsigned char *, size_t, unichar *, size_t *);
+-private int looks_utf8_with_BOM(const unsigned char *, size_t, unichar *,
++private int looks_ascii(const unsigned char *, size_t, unicodechar *, size_t *);
++private int looks_utf8_with_BOM(const unsigned char *, size_t, unicodechar *,
+ size_t *);
+-private int looks_utf7(const unsigned char *, size_t, unichar *, size_t *);
+-private int looks_ucs16(const unsigned char *, size_t, unichar *, size_t *);
+-private int looks_ucs32(const unsigned char *, size_t, unichar *, size_t *);
+-private int looks_latin1(const unsigned char *, size_t, unichar *, size_t *);
+-private int looks_extended(const unsigned char *, size_t, unichar *, size_t *);
++private int looks_utf7(const unsigned char *, size_t, unicodechar *, size_t *);
++private int looks_ucs16(const unsigned char *, size_t, unicodechar *, size_t *);
++private int looks_ucs32(const unsigned char *, size_t, unicodechar *, size_t *);
++private int looks_latin1(const unsigned char *, size_t, unicodechar *, size_t *);
++private int looks_extended(const unsigned char *, size_t, unicodechar *, size_t *);
+ private void from_ebcdic(const unsigned char *, size_t, unsigned char *);
+
+ #ifdef DEBUG_ENCODING
+@@ -62,11 +62,11 @@
+ /*
+ * Try to determine whether text is in some character code we can
+ * identify. Each of these tests, if it succeeds, will leave
+- * the text converted into one-unichar-per-character Unicode in
++ * the text converted into one-unicodechar-per-character Unicode in
+ * ubuf, and the number of characters converted in ulen.
+ */
+ protected int
+-file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf,
++file_encoding(struct magic_set *ms, const struct buffer *b, unicodechar **ubuf,
+ size_t *ulen, const char **code, const char **code_mime, const char **type)
+ {
+ const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
+@@ -74,7 +74,7 @@
+ size_t mlen;
+ int rv = 1, ucs_type;
+ unsigned char *nbuf = NULL;
+- unichar *udefbuf;
++ unicodechar *udefbuf;
+ size_t udeflen;
+
+ if (ubuf == NULL)
+@@ -88,13 +88,13 @@
*code_mime = "binary";
mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
return rv;
}
- diff -ur libmagic.orig/file.h libmagic/file.h
+@@ -250,7 +250,7 @@
+ };
+
+ private int
+-looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf,
++looks_ascii(const unsigned char *buf, size_t nbytes, unicodechar *ubuf,
+ size_t *ulen)
+ {
+ size_t i;
+@@ -270,7 +270,7 @@
+ }
+
+ private int
+-looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
++looks_latin1(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen)
+ {
+ size_t i;
+
+@@ -289,7 +289,7 @@
+ }
+
+ private int
+-looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf,
++looks_extended(const unsigned char *buf, size_t nbytes, unicodechar *ubuf,
+ size_t *ulen)
+ {
+ size_t i;
+@@ -320,11 +320,11 @@
+ * ubuf must be big enough!
+ */
+ protected int
+-file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
++file_looks_utf8(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen)
+ {
+ size_t i;
+ int n;
+- unichar c;
++ unicodechar c;
+ int gotone = 0, ctrl = 0;
+
+ if (ubuf)
+@@ -391,7 +391,7 @@
+ * rest of the text.
+ */
+ private int
+-looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf,
++looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unicodechar *ubuf,
+ size_t *ulen)
+ {
+ if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
+@@ -401,7 +401,7 @@
+ }
+
+ private int
+-looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
++looks_utf7(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen)
+ {
+ if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
+ switch (buf[3]) {
+@@ -420,7 +420,7 @@
+ }
+
+ private int
+-looks_ucs16(const unsigned char *bf, size_t nbytes, unichar *ubf,
++looks_ucs16(const unsigned char *bf, size_t nbytes, unicodechar *ubf,
+ size_t *ulen)
+ {
+ int bigend;
+@@ -443,10 +443,10 @@
+
+ if (bigend)
+ ubf[(*ulen)++] = bf[i + 1]
+- | (CAST(unichar, bf[i]) << 8);
++ | (CAST(unicodechar, bf[i]) << 8);
+ else
+ ubf[(*ulen)++] = bf[i]
+- | (CAST(unichar, bf[i + 1]) << 8);
++ | (CAST(unicodechar, bf[i + 1]) << 8);
+
+ if (ubf[*ulen - 1] == 0xfffe)
+ return 0;
+@@ -459,7 +459,7 @@
+ }
+
+ private int
+-looks_ucs32(const unsigned char *bf, size_t nbytes, unichar *ubf,
++looks_ucs32(const unsigned char *bf, size_t nbytes, unicodechar *ubf,
+ size_t *ulen)
+ {
+ int bigend;
+@@ -481,15 +481,15 @@
+ /* XXX fix to properly handle chars > 65536 */
+
+ if (bigend)
+- ubf[(*ulen)++] = CAST(unichar, bf[i + 3])
+- | (CAST(unichar, bf[i + 2]) << 8)
+- | (CAST(unichar, bf[i + 1]) << 16)
+- | (CAST(unichar, bf[i]) << 24);
++ ubf[(*ulen)++] = CAST(unicodechar, bf[i + 3])
++ | (CAST(unicodechar, bf[i + 2]) << 8)
++ | (CAST(unicodechar, bf[i + 1]) << 16)
++ | (CAST(unicodechar, bf[i]) << 24);
+ else
+- ubf[(*ulen)++] = CAST(unichar, bf[i + 0])
+- | (CAST(unichar, bf[i + 1]) << 8)
+- | (CAST(unichar, bf[i + 2]) << 16)
+- | (CAST(unichar, bf[i + 3]) << 24);
++ ubf[(*ulen)++] = CAST(unicodechar, bf[i + 0])
++ | (CAST(unicodechar, bf[i + 1]) << 8)
++ | (CAST(unicodechar, bf[i + 2]) << 16)
++ | (CAST(unicodechar, bf[i + 3]) << 24);
+
+ if (ubf[*ulen - 1] == 0xfffe)
+ return 0;
---- libmagic.orig/file.h 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/file.h 2020-11-23 17:11:36.234964700 +0100
-@@ -33,18 +33,9 @@
+ diff -u libmagic.orig/file.h libmagic/file.h
- +++ libmagic/file.h 2020-09-02 17:35:51.709611515 +0200
+--- libmagic.orig/file.h 2020-06-15 02:01:01.000000000 +0200
+++++ libmagic/file.h 2020-11-24 13:44:41.506472900 +0100
+@@ -33,17 +33,13 @@
#ifndef __file_h__
#define __file_h__
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
--#ifdef HAVE_STDINT_H
--#ifndef __STDC_LIMIT_MACROS
--#define __STDC_LIMIT_MACROS
--#endif
--#ifndef __STDC_FORMAT_MACROS
--#define __STDC_FORMAT_MACROS
--#endif
+#include "config.h"
--#ifdef WIN32
-+#ifdef PHP_WIN32
- #ifdef _WIN64
- #define SIZE_T_FORMAT "I64"
- #else
-@@ -57,32 +48,49 @@
- #define INT64_T_FORMAT "ll"
- #define INTMAX_T_FORMAT "j"
- #endif
+-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
++#include "ext/standard/php_string.h"
++#include "ext/pcre/php_pcre.h"
- @@ -79,10 +75,11 @@
+-#ifdef HAVE_INTTYPES_H
++#include <stdint.h>
+ #include <inttypes.h>
+-#endif
+
+ #ifndef __STDC_LIMIT_MACROS
+ #define __STDC_LIMIT_MACROS
++@@ -79,23 +75,26 @@
#include <stdio.h> /* Include that here, to make sure __P gets defined */
#include <errno.h>
#include <fcntl.h> /* For open and flags */
#define PATHSEP ';'
#else
#define PATHSEP ':'
- @@ -129,12 +126,6 @@
-@@ -116,12 +124,6 @@
++@@ -129,12 +128,6 @@
#endif
#endif
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
- @@ -161,10 +152,10 @@
-@@ -150,10 +152,10 @@
++@@ -161,10 +154,10 @@
struct buffer {
int fd;
void *ebuf;
size_t elen;
};
- @@ -258,7 +249,7 @@
-@@ -243,7 +245,7 @@
- #define FILE_DER 48
- #define FILE_NAMES_SIZE 49 /* size of array to contain all names */
++@@ -258,7 +251,7 @@
+ #define FILE_OFFSET 50
+ #define FILE_NAMES_SIZE 51 /* size of array to contain all names */
-#define IS_STRING(t) \
+#define IS_LIBMAGIC_STRING(t) \
((t) == FILE_STRING || \
(t) == FILE_PSTRING || \
(t) == FILE_BESTRING16 || \
- @@ -464,21 +455,17 @@
-@@ -447,28 +449,23 @@
++@@ -464,21 +457,17 @@
+ };
+
/* Type for Unicode characters */
- typedef unsigned long unichar;
+-typedef unsigned long unichar;
++typedef unsigned long unicodechar;
-struct stat;
#define FILE_T_LOCAL 1
-protected int file_vprintf(struct magic_set *, const char *, va_list)
- __attribute__((__format__(__printf__, 2, 0)));
protected int file_separator(struct magic_set *);
- protected size_t file_printedlen(const struct magic_set *);
+ protected char *file_copystr(char *, size_t, size_t, const char *);
+ protected int file_checkfmt(char *, size_t, const char *);
- @@ -486,48 +473,42 @@
++@@ -486,48 +475,42 @@
+ protected int file_print_guid(char *, size_t, const uint64_t *);
+ protected int file_parse_guid(const char *, uint64_t *);
protected int file_replace(struct magic_set *, const char *, const char *);
-protected int file_printf(struct magic_set *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
protected void file_showstr(FILE *, const char *, size_t);
protected size_t file_mbswidth(const char *);
protected const char *file_getbuffer(struct magic_set *);
-@@ -513,34 +506,13 @@
+ protected ssize_t sread(int, void *, size_t, int);
+ protected int file_check_mem(struct magic_set *, unsigned int);
+-protected int file_looks_utf8(const unsigned char *, size_t, unichar *,
++protected int file_looks_utf8(const unsigned char *, size_t, unicodechar *,
+ size_t *);
+ protected size_t file_pstring_length_size(struct magic_set *,
+ const struct magic *);
- @@ -539,34 +520,12 @@
++@@ -539,34 +522,12 @@
size_t);
#endif /* __EMX__ */
typedef struct {
char *buf;
- @@ -582,23 +541,10 @@
-@@ -550,28 +522,13 @@
- protected file_pushbuf_t *file_push_buffer(struct magic_set *);
- protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
-
--#ifndef COMPILE_ONLY
- extern const char *file_names[];
++@@ -582,23 +543,10 @@
extern const size_t file_nnames;
--#endif
+ #endif
-#ifndef HAVE_PREAD
-ssize_t pread(int, void *, size_t, off_t);
size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRCASESTR
- @@ -614,39 +560,6 @@
-@@ -587,39 +544,6 @@
++@@ -614,39 +562,6 @@
#ifndef HAVE_ASCTIME_R
char *asctime_r(const struct tm *, char *);
#endif
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
#define QUICK
- @@ -676,4 +589,16 @@
-@@ -645,6 +569,18 @@
- #else
- #define FILE_RCSID(id)
++@@ -676,4 +591,16 @@
+ #define __RCSID(a)
#endif
-+
+
+#ifdef PHP_WIN32
+#ifdef _WIN64
+#define FINFO_LSEEK_FUNC _lseeki64
+#define FINFO_LSEEK_FUNC lseek
+#define FINFO_READ_FUNC read
+#endif
- #ifndef __RCSID
- #define __RCSID(a)
- #endif
++
+ #endif /* __file_h__ */
- diff -ur libmagic.orig/fsmagic.c libmagic/fsmagic.c
+ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
---- libmagic.orig/fsmagic.c 2019-05-07 04:26:48.000000000 +0200
-+++ libmagic/fsmagic.c 2020-09-07 00:42:14.447562400 +0200
+--- libmagic.orig/fsmagic.c 2019-07-16 15:30:32.000000000 +0200
- +++ libmagic/fsmagic.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/fsmagic.c 2020-11-07 14:41:13.559464400 +0100
@@ -66,26 +66,10 @@
# define minor(dev) ((dev) & 0xff)
#endif
#ifdef S_IFSOCK
#ifndef __COHERENT__
case S_IFSOCK:
- diff -ur libmagic.orig/funcs.c libmagic/funcs.c
+ diff -u libmagic.orig/funcs.c libmagic/funcs.c
---- libmagic.orig/funcs.c 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/funcs.c 2020-09-07 00:42:14.447562400 +0200
-@@ -31,7 +31,6 @@
- #endif /* lint */
-
- #include "magic.h"
--#include <assert.h>
- #include <stdarg.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -48,70 +47,68 @@
+--- libmagic.orig/funcs.c 2020-02-20 16:50:20.000000000 +0100
- +++ libmagic/funcs.c 2020-08-29 11:56:12.303522747 +0200
+++++ libmagic/funcs.c 2020-11-07 14:41:13.559464400 +0100
+@@ -48,6 +48,13 @@
#define SIZE_MAX ((size_t)~0)
#endif
return rbuf;
}
- diff -ur libmagic.orig/magic.c libmagic/magic.c
+ diff -u libmagic.orig/magic.c libmagic/magic.c
---- libmagic.orig/magic.c 2019-05-07 04:27:11.000000000 +0200
-+++ libmagic/magic.c 2020-09-07 00:42:14.447562400 +0200
+--- libmagic.orig/magic.c 2020-06-15 02:01:01.000000000 +0200
- +++ libmagic/magic.c 2020-08-29 11:56:12.303522747 +0200
+++++ libmagic/magic.c 2020-11-07 14:41:13.559464400 +0100
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
return NULL;
}
return file_getbuffer(ms);
- diff -ur libmagic.orig/magic.h libmagic/magic.h
- --- libmagic.orig/magic.h 2020-06-29 01:13:35.424557511 +0200
- +++ libmagic/magic.h 2020-08-29 02:05:56.212049441 +0200
- }
--#endif
-
- public const char *
- magic_error(struct magic_set *ms)
+ diff -u libmagic.orig/magic.h libmagic/magic.h
---- libmagic.orig/magic.h 2020-11-23 17:12:12.776465800 +0100
-+++ libmagic/magic.h 2020-09-07 00:42:14.447562400 +0200
-@@ -124,6 +124,7 @@
++--- libmagic.orig/magic.h 2020-11-24 13:45:15.355600300 +0100
+++++ libmagic/magic.h 2020-11-07 14:41:13.559464400 +0100
+@@ -126,6 +126,7 @@
const char *magic_getpath(const char *, int);
const char *magic_file(magic_t, const char *);
const char *magic_descriptor(magic_t, int);
const char *magic_buffer(magic_t, const void *, size_t);
- diff -ur libmagic.orig/print.c libmagic/print.c
+ diff -u libmagic.orig/print.c libmagic/print.c
---- libmagic.orig/print.c 2019-03-12 21:43:05.000000000 +0100
-+++ libmagic/print.c 2020-09-07 00:42:14.447562400 +0200
+--- libmagic.orig/print.c 2020-05-09 20:57:15.000000000 +0200
- +++ libmagic/print.c 2020-08-29 11:56:12.303522747 +0200
+++++ libmagic/print.c 2020-11-07 14:41:13.559464400 +0100
@@ -28,6 +28,7 @@
/*
* print.c - debugging printout routines
if (pp == NULL)
goto out;
- diff -ur libmagic.orig/readcdf.c libmagic/readcdf.c
+ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
---- libmagic.orig/readcdf.c 2019-03-12 21:43:05.000000000 +0100
-+++ libmagic/readcdf.c 2020-09-07 00:42:14.463191200 +0200
+--- libmagic.orig/readcdf.c 2019-09-30 17:42:50.000000000 +0200
- +++ libmagic/readcdf.c 2020-08-29 02:05:56.212049441 +0200
+++++ libmagic/readcdf.c 2020-11-07 14:41:13.559464400 +0100
@@ -31,7 +31,11 @@
#include <assert.h>
out0:
/* If we handled it already, return */
if (i != -1)
- diff -ur libmagic.orig/softmagic.c libmagic/softmagic.c
+ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
---- libmagic.orig/softmagic.c 2019-05-17 04:24:59.000000000 +0200
-+++ libmagic/softmagic.c 2020-09-07 00:42:14.463191200 +0200
+--- libmagic.orig/softmagic.c 2020-06-15 02:01:01.000000000 +0200
- +++ libmagic/softmagic.c 2020-09-02 20:04:00.794667114 +0200
+++++ libmagic/softmagic.c 2020-11-07 14:41:13.559464400 +0100
@@ -43,6 +43,10 @@
#include <time.h>
#include "der.h"
break;
}
case FILE_INDIRECT:
- diff -ur libmagic.orig/strcasestr.c libmagic/strcasestr.c
+ diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c 2014-09-11 17:05:33.000000000 +0200
- +++ libmagic/strcasestr.c 2020-07-04 12:40:36.675619260 +0200
-+++ libmagic/strcasestr.c 2020-08-05 15:01:55.644887300 +0200
+++++ libmagic/strcasestr.c 2020-10-09 14:15:33.499288400 +0200
@@ -39,6 +39,8 @@
#include "file.h"