Fix for #560
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ typedef enum
|
||||
* continue searching, otherwise it will return from ac_automata_search()
|
||||
* to your calling function.
|
||||
**/
|
||||
typedef int (*MATCH_CALBACK_f)(AC_MATCH_t *, void *);
|
||||
typedef int (*MATCH_CALBACK_f)(AC_MATCH_t *, AC_TEXT_t *, void *);
|
||||
|
||||
/* AC_PATTRN_MAX_LENGTH:
|
||||
* Maximum acceptable pattern length in AC_PATTERN_t.length
|
||||
|
||||
+2
-3
@@ -189,16 +189,15 @@ int ac_automata_search (AC_AUTOMATA_t * thiz, AC_TEXT_t * txt, void * param)
|
||||
position++;
|
||||
}
|
||||
|
||||
if(curr->final && next)
|
||||
if(curr->final && next) {
|
||||
/* We check 'next' to find out if we came here after a alphabet
|
||||
* transition or due to a fail. in second case we should not report
|
||||
* matching because it was reported in previous node */
|
||||
{
|
||||
thiz->match.position = position + thiz->base_position;
|
||||
thiz->match.match_num = curr->matched_patterns_num;
|
||||
thiz->match.patterns = curr->matched_patterns;
|
||||
/* we found a match! do call-back */
|
||||
if (thiz->match_callback(&thiz->match, param))
|
||||
if (thiz->match_callback(&thiz->match, txt, param))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user