mirror of
https://github.com/cesanta/slre.git
synced 2024-11-17 08:55:30 +00:00
Fixed error message reporting for the case when regex exhaust tested string
This commit is contained in:
parent
e5d1a3901a
commit
acd861b945
2
slre.c
2
slre.c
@ -275,7 +275,7 @@ static int bar(const char *re, int re_len, const char *s, int s_len,
|
|||||||
} else if (re[i] == '$') {
|
} else if (re[i] == '$') {
|
||||||
FAIL_IF(j != s_len, static_error_no_match);
|
FAIL_IF(j != s_len, static_error_no_match);
|
||||||
} else {
|
} else {
|
||||||
FAIL_IF(j == s_len, info->error_msg);
|
FAIL_IF(j >= s_len, static_error_no_match);
|
||||||
n = match_op((unsigned char *) (re + i), (unsigned char *) (s + j), info);
|
n = match_op((unsigned char *) (re + i), (unsigned char *) (s + j), info);
|
||||||
FAIL_IF(n <= 0, info->error_msg);
|
FAIL_IF(n <= 0, info->error_msg);
|
||||||
j += n;
|
j += n;
|
||||||
|
Loading…
Reference in New Issue
Block a user