@@ -43,7 +43,7 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.328 2022/09/13 18:46:07 christos Exp $")
43
43
#include <time.h>
44
44
#include "der.h"
45
45
46
- private int match (struct magic_set * , struct magic * , file_regex_t * * , size_t ,
46
+ private int match (struct magic_set * , struct magic * , size_t ,
47
47
const struct buffer * , size_t , int , int , int , uint16_t * ,
48
48
uint16_t * , int * , int * , int * , int * );
49
49
private int mget (struct magic_set * , struct magic * , const struct buffer * ,
@@ -52,7 +52,7 @@ private int mget(struct magic_set *, struct magic *, const struct buffer *,
52
52
uint16_t * , int * , int * , int * , int * );
53
53
private int msetoffset (struct magic_set * , struct magic * , struct buffer * ,
54
54
const struct buffer * , size_t , unsigned int );
55
- private int magiccheck (struct magic_set * , struct magic * , file_regex_t * * );
55
+ private int magiccheck (struct magic_set * , struct magic * );
56
56
private int mprint (struct magic_set * , struct magic * );
57
57
private int moffset (struct magic_set * , struct magic * , const struct buffer * ,
58
58
int32_t * );
@@ -131,7 +131,7 @@ file_softmagic(struct magic_set *ms, const struct buffer *b,
131
131
}
132
132
133
133
for (ml = ms -> mlist [0 ]-> next ; ml != ms -> mlist [0 ]; ml = ml -> next ) {
134
- int ret = match (ms , ml -> magic , ml -> magic_rxcomp , ml -> nmagic , b ,
134
+ int ret = match (ms , ml -> magic , ml -> nmagic , b ,
135
135
0 , mode , text , 0 , indir_count , name_count ,
136
136
& printed_something , & need_separator , NULL , NULL );
137
137
switch (ret ) {
@@ -206,7 +206,7 @@ file_fmtcheck(struct magic_set *ms, const char *desc, const char *def,
206
206
* so that higher-level continuations are processed.
207
207
*/
208
208
private int
209
- match (struct magic_set * ms , struct magic * magic , file_regex_t * * magic_rxcomp ,
209
+ match (struct magic_set * ms , struct magic * magic ,
210
210
size_t nmagic , const struct buffer * b , size_t offset , int mode , int text ,
211
211
int flip , uint16_t * indir_count , uint16_t * name_count ,
212
212
int * printed_something , int * need_separator , int * returnval ,
@@ -236,7 +236,6 @@ match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp,
236
236
for (magindex = 0 ; magindex < nmagic ; magindex ++ ) {
237
237
int flush = 0 ;
238
238
struct magic * m = & magic [magindex ];
239
- file_regex_t * * m_rxcomp = & magic_rxcomp [magindex ];
240
239
241
240
if (m -> type != FILE_NAME )
242
241
if ((IS_LIBMAGIC_STRING (m -> type ) &&
@@ -274,7 +273,7 @@ match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp,
274
273
* returnval = 1 ;
275
274
}
276
275
277
- switch (magiccheck (ms , m , m_rxcomp )) {
276
+ switch (magiccheck (ms , m )) {
278
277
case -1 :
279
278
return -1 ;
280
279
case 0 :
@@ -335,7 +334,6 @@ match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp,
335
334
while (magindex + 1 < nmagic &&
336
335
magic [magindex + 1 ].cont_level != 0 ) {
337
336
m = & magic [++ magindex ];
338
- m_rxcomp = & magic_rxcomp [magindex ];
339
337
ms -> line = m -> lineno ; /* for messages */
340
338
341
339
if (cont_level < m -> cont_level )
@@ -389,7 +387,7 @@ match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp,
389
387
break ;
390
388
}
391
389
392
- switch (flush ? 1 : magiccheck (ms , m , m_rxcomp )) {
390
+ switch (flush ? 1 : magiccheck (ms , m )) {
393
391
case -1 :
394
392
return -1 ;
395
393
case 0 :
@@ -1870,7 +1868,7 @@ mget(struct magic_set *ms, struct magic *m, const struct buffer *b,
1870
1868
for (mlp = ms -> mlist [0 ]-> next ; mlp != ms -> mlist [0 ];
1871
1869
mlp = mlp -> next )
1872
1870
{
1873
- if ((rv = match (ms , mlp -> magic , mlp -> magic_rxcomp ,
1871
+ if ((rv = match (ms , mlp -> magic ,
1874
1872
mlp -> nmagic , & bb , 0 , BINTEST , text , 0 , indir_count ,
1875
1873
name_count , printed_something , need_separator ,
1876
1874
NULL , NULL )) != 0 )
@@ -1923,7 +1921,7 @@ mget(struct magic_set *ms, struct magic *m, const struct buffer *b,
1923
1921
nfound_match = 0 ;
1924
1922
(* name_count )++ ;
1925
1923
eoffset = ms -> eoffset ;
1926
- rv = match (ms , ml .magic , ml .magic_rxcomp , ml . nmagic , b ,
1924
+ rv = match (ms , ml .magic , ml .nmagic , b ,
1927
1925
offset + o , mode , text , flip , indir_count , name_count ,
1928
1926
printed_something , need_separator , returnval ,
1929
1927
& nfound_match );
@@ -2047,7 +2045,7 @@ file_strncmp16(const char *a, const char *b, size_t len, size_t maxlen,
2047
2045
}
2048
2046
2049
2047
private int
2050
- magiccheck (struct magic_set * ms , struct magic * m , file_regex_t * * m_cache )
2048
+ magiccheck (struct magic_set * ms , struct magic * m )
2051
2049
{
2052
2050
uint64_t l = m -> value .q ;
2053
2051
uint64_t v ;
0 commit comments