Skip to content

Commit f8be942

Browse files
committed
Remove convoluted usage of NDEBUG in libmagic
1 parent 5bc1e22 commit f8be942

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ext/fileinfo/libmagic.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ diff -u libmagic.orig/buffer.c libmagic/buffer.c
10621062

10631063
diff -u libmagic.orig/cdf.c libmagic/cdf.c
10641064
--- libmagic.orig/cdf.c 2019-02-20 03:35:27.000000000 +0100
1065-
+++ libmagic/cdf.c 2020-04-07 22:25:10.517321000 +0200
1065+
+++ libmagic/cdf.c 2020-05-05 18:42:24.973318200 +0200
10661066
@@ -43,7 +43,17 @@
10671067
#include <err.h>
10681068
#endif
@@ -1138,7 +1138,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
11381138
static size_t
11391139
cdf_check_stream(const cdf_stream_t *sst, const cdf_header_t *h)
11401140
{
1141-
+#ifndef NDEBUG
1141+
+#if PHP_DEBUG
11421142
size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
11431143
CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
11441144
assert(ss == sst->sst_ss);
@@ -1636,7 +1636,7 @@ diff -u libmagic.orig/encoding.c libmagic/encoding.c
16361636
}
16371637
diff -u libmagic.orig/file.h libmagic/file.h
16381638
--- libmagic.orig/file.h 2019-05-07 04:27:11.000000000 +0200
1639-
+++ libmagic/file.h 2020-04-22 20:15:46.790840100 +0200
1639+
+++ libmagic/file.h 2020-05-05 18:41:04.309311200 +0200
16401640
@@ -33,18 +33,9 @@
16411641
#ifndef __file_h__
16421642
#define __file_h__
@@ -2212,7 +2212,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
22122212
case S_IFSOCK:
22132213
diff -u libmagic.orig/funcs.c libmagic/funcs.c
22142214
--- libmagic.orig/funcs.c 2019-05-07 04:27:11.000000000 +0200
2215-
+++ libmagic/funcs.c 2020-04-14 17:15:50.737587100 +0200
2215+
+++ libmagic/funcs.c 2020-05-05 18:41:04.309311200 +0200
22162216
@@ -31,87 +31,80 @@
22172217
#endif /* lint */
22182218

@@ -3048,7 +3048,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
30483048
public const char *
30493049
magic_error(struct magic_set *ms)
30503050
diff -u libmagic.orig/magic.h libmagic/magic.h
3051-
--- libmagic.orig/magic.h 2020-04-22 20:17:15.432186600 +0200
3051+
--- libmagic.orig/magic.h 2020-05-05 18:42:44.544159800 +0200
30523052
+++ libmagic/magic.h 2020-04-07 22:25:10.548560600 +0200
30533053
@@ -124,6 +124,7 @@
30543054

@@ -3253,7 +3253,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
32533253
if (i != -1)
32543254
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
32553255
--- libmagic.orig/softmagic.c 2019-05-17 04:24:59.000000000 +0200
3256-
+++ libmagic/softmagic.c 2020-04-07 22:25:10.548560600 +0200
3256+
+++ libmagic/softmagic.c 2020-04-26 00:43:35.734037100 +0200
32573257
@@ -43,6 +43,10 @@
32583258
#include <time.h>
32593259
#include "der.h"

ext/fileinfo/libmagic/cdf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ cdf_zero_stream(cdf_stream_t *scn)
297297
static size_t
298298
cdf_check_stream(const cdf_stream_t *sst, const cdf_header_t *h)
299299
{
300-
#ifndef NDEBUG
300+
#if PHP_DEBUG
301301
size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
302302
CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
303303
assert(ss == sst->sst_ss);

0 commit comments

Comments
 (0)