From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0FC8F1F5AE for ; Wed, 26 May 2021 09:09:39 +0000 (UTC) Received: from localhost ([::1]:34084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llpXl-0007pi-RM for normalperson@yhbt.net; Wed, 26 May 2021 05:09:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llpX0-0006gE-E4 for bug-gnulib@gnu.org; Wed, 26 May 2021 05:08:50 -0400 Received: from air.basealt.ru ([194.107.17.39]:36914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llpWx-0006Av-92 for bug-gnulib@gnu.org; Wed, 26 May 2021 05:08:50 -0400 Received: by air.basealt.ru (Postfix, from userid 490) id E313D589433; Wed, 26 May 2021 09:08:42 +0000 (UTC) Received: from EGORI-MACHINE.malta.altlinux.ru (obninsk.basealt.ru [217.15.195.17]) by air.basealt.ru (Postfix) with ESMTPSA id 334A8589885; Wed, 26 May 2021 09:08:40 +0000 (UTC) From: Egor Ignatov To: eggert@cs.ucla.edu Subject: [PATCH] regex: fix match with possessive quantifier Date: Wed, 26 May 2021 12:08:19 +0300 Message-Id: <20210526090819.7482-1-egori@altlinux.org> X-Mailer: git-send-email 2.29.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=194.107.17.39; envelope-from=egori@altlinux.org; helo=air.basealt.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "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 --- 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