mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 10:23:17 +00:00
minor optimisation
git-svn: trunk@3251
This commit is contained in:
parent
126efa7c22
commit
ecf5865b53
3 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Sep 26 23:36:06 CEST 2007 (tk)
|
||||
----------------------------------
|
||||
* libclamav/matcher-ac.c: minor optimisation
|
||||
|
||||
Tue Sep 25 10:43:35 BST 2007 (njh)
|
||||
----------------------------------
|
||||
* libclamav/mbox.c: Only use strcasestr on Linux (for now, until it
|
||||
|
|
|
@ -331,6 +331,14 @@ void cli_ac_free(struct cli_matcher *root)
|
|||
|
||||
#define AC_MATCH_CHAR(p,b) \
|
||||
switch(wc = p & CLI_MATCH_WILDCARD) { \
|
||||
case CLI_MATCH_CHAR: \
|
||||
if((unsigned char) p != b) \
|
||||
return 0; \
|
||||
break; \
|
||||
\
|
||||
case CLI_MATCH_IGNORE: \
|
||||
break; \
|
||||
\
|
||||
case CLI_MATCH_ALTERNATIVE: \
|
||||
found = 0; \
|
||||
for(j = 0; j < pattern->altn[alt]; j++) { \
|
||||
|
@ -355,8 +363,8 @@ void cli_ac_free(struct cli_matcher *root)
|
|||
break; \
|
||||
\
|
||||
default: \
|
||||
if(wc != CLI_MATCH_IGNORE && (unsigned char) p != b) \
|
||||
return 0; \
|
||||
cli_errmsg("ac_findmatch: Unknown wildcard 0x%x\n", wc); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
inline static int ac_findmatch(const unsigned char *buffer, uint32_t offset, uint32_t length, const struct cli_ac_patt *pattern)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "matcher-bm.h"
|
||||
|
||||
#define CLI_MATCH_WILDCARD 0xff00
|
||||
#define CLI_MATCH_CHAR 0x0000
|
||||
#define CLI_MATCH_IGNORE 0x0100
|
||||
#define CLI_MATCH_ALTERNATIVE 0x0200
|
||||
#define CLI_MATCH_NIBBLE_HIGH 0x0300
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue