]> git.xolatile.top Git - public-libhl.git/commitdiff
word boundary regex bug fix
authoranon <anon@anon.anon>
Mon, 21 Aug 2023 14:13:50 +0000 (16:13 +0200)
committeranon <anon@anon.anon>
Mon, 21 Aug 2023 14:13:50 +0000 (16:13 +0200)
source/regex.c

index e9e27877c3f7570794a5f2516ff5ed99a35a3311..d87de0e310bd84b0fea3042d2e1493971169e693 100644 (file)
@@ -161,9 +161,11 @@ int regex_match(const char * const pattern,
                        }
 
                        if (*(pattern_pointer + 1) == '<'
-                       && is_word_separator(*string_pointer)) {
+                       && (is_word_separator(*string_pointer))
+                       ||  string_pointer == string_start) {
                                        pattern_pointer += 2;
                                        string_pointer += 1;
+                                       match_offset = string_pointer - (string_start + string_offset);
                                        continue;
                        }