aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2023-09-26 11:43:51 -0400
committerStefan Monnier2023-09-26 11:43:51 -0400
commite88be844bf774b336ab67995e435416328b53776 (patch)
treed937036da59671bcde1c1bff176c31605db47b74 /src
parent215bfb24dd0de9ba2c82aea330cbb27985ad6eae (diff)
downloademacs-e88be844bf774b336ab67995e435416328b53776.tar.gz
emacs-e88be844bf774b336ab67995e435416328b53776.zip
regex.c (mutually_exclusive_p): Fix initial value of `loop_beg`
* src/regex-emacs.c (mutually_exclusive_p): Don't pretend that pattern position 0 has been checked already. * test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization): Add a corresponding regression test plus some other related tests I had around.
Diffstat (limited to 'src')
-rw-r--r--src/regex-emacs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index cf7b704ee95..338323cf79e 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -3941,7 +3941,7 @@ static bool
3941mutually_exclusive_p (struct re_pattern_buffer *bufp, re_char *p1, 3941mutually_exclusive_p (struct re_pattern_buffer *bufp, re_char *p1,
3942 re_char *p2) 3942 re_char *p2)
3943{ 3943{
3944 return mutually_exclusive_aux (bufp, p1, p2, bufp->buffer, NULL); 3944 return mutually_exclusive_aux (bufp, p1, p2, bufp->buffer - 1, NULL);
3945} 3945}
3946 3946
3947/* Matching routines. */ 3947/* Matching routines. */