aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/third_party/src/ahocorasick.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/third_party/src/ahocorasick.c b/src/lib/third_party/src/ahocorasick.c
index 27134c0cc..c2b958bb3 100644
--- a/src/lib/third_party/src/ahocorasick.c
+++ b/src/lib/third_party/src/ahocorasick.c
@@ -104,9 +104,17 @@ AC_ERROR_t ac_automata_add (AC_AUTOMATA_t * thiz, AC_PATTERN_t * patt)
}
}
- if(n->final)
+ if(n->final) {
+#if 0
+ /* Original code */
return ACERR_DUPLICATE_PATTERN;
-
+#else
+ /* ntop */
+ memcpy(&n->matched_patterns->rep, &patt->rep, sizeof(AC_REP_t));
+ return ACERR_SUCCESS;
+#endif
+ }
+
n->final = 1;
node_register_matchstr(n, patt, 0);
thiz->total_patterns++;