bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] regex: fix match with possessive quantifier
@ 2021-05-26  9:08 Egor Ignatov
  2021-06-06 21:45 ` Dmitry V. Levin
  0 siblings, 1 reply; 13+ messages in thread
From: Egor Ignatov @ 2021-05-26  9:08 UTC (permalink / raw)
  To: eggert; +Cc: bug-gnulib

Fix behaviour introduced in 70b673e, where regexps with
possessive quantifier("*+") didn't match.
* lib/regexec.c
(set_regs): Pop if CUR_NODE has already been checked only when
we have a fail stack.

Signed-off-by: Egor Ignatov <egori@altlinux.org>
---
Hi Paul,

Do you have any test cases for bug 11053(glibc) for gnulib?
This patch fixes the issue with "*+", but I'm not sure it
doesn't break your fix for 11053.

Best regards,
Egor

 lib/regexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/regexec.c b/lib/regexec.c
index 6309deac8..5d4113c9d 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -1414,7 +1414,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
       update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
 
       if ((idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
-	  || re_node_set_contains (&eps_via_nodes, cur_node))
+	  || (fs && re_node_set_contains (&eps_via_nodes, cur_node)))
 	{
 	  Idx reg_idx;
 	  cur_node = -1;
-- 
2.29.3



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-07-09 12:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26  9:08 [PATCH] regex: fix match with possessive quantifier Egor Ignatov
2021-06-06 21:45 ` Dmitry V. Levin
2021-06-07  1:10   ` Dmitry V. Levin
2021-06-16  9:46     ` [PATCH] regex: fix backreference matching Egor Ignatov
2021-06-16 10:13       ` Dmitry V. Levin
2021-06-29  8:51         ` Egor Ignatov
2021-07-05 12:12           ` Dmitry V. Levin
2021-07-09 12:36             ` [PATCH v2] " Egor Ignatov
2021-06-16 10:18     ` [PATCH] regex: fix match with possessive quantifier Dmitry V. Levin
2021-06-21 21:09   ` Paul Eggert
2021-06-22 15:35     ` Egor Ignatov
2021-06-22 15:35       ` [PATCH] regex: fix assertion in re_node_set_insert Egor Ignatov
2021-06-22 19:41         ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).