aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-28 15:47:51 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-28 15:47:51 +0100
commit0e21da4e3833d702db12e4129926d7918a1ac527 (patch)
tree70a65482b883c20bfe53655c8f83ec7f07c2cf16 /src/libutil/regexp.c
parenta95c5a23edaddafa96a9c62da4d541abc680b2c5 (diff)
downloadrspamd-0e21da4e3833d702db12e4129926d7918a1ac527.tar.gz
rspamd-0e21da4e3833d702db12e4129926d7918a1ac527.zip
[Project] Add `L` flag for regexps to save start of the match in Hyperscan
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r--src/libutil/regexp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 396da80d1..ce764a893 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -406,6 +406,10 @@ rspamd_regexp_new (const gchar *pattern, const gchar *flags,
/* We optimize all regexps by default */
rspamd_flags |= RSPAMD_REGEXP_FLAG_NOOPT;
break;
+ case 'L':
+ /* SOM_LEFTMOST hyperscan flag */
+ rspamd_flags |= RSPAMD_REGEXP_FLAG_LEFTMOST;
+ break;
case 'r':
rspamd_flags |= RSPAMD_REGEXP_FLAG_RAW;
rspamd_flags &= ~RSPAMD_REGEXP_FLAG_UTF;