From f5569e29cc15e93a9e058b202084f76daa922755 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 5 Nov 2025 17:29:05 +0100 Subject: [PATCH] src/bin/grepc_c: -tum: Split regex part for the replacement list While splitting, improve the regex part in two ways: - Use a non-capturing group. This improves performance. - Use negative lookahead instead of '[^\\]$'. This allows matching a macro where the searched identifier is the last thing in the replacement list. Signed-off-by: Alejandro Colomar --- src/bin/grepc_c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/grepc_c b/src/bin/grepc_c index 9ca87a1ba..c752dec19 100755 --- a/src/bin/grepc_c +++ b/src/bin/grepc_c @@ -119,6 +119,7 @@ grepc_c_mf_decl_() { grepc_c_m_decl_ "$1"; grepc_c_mo_decl_() { grepc_c_m_decl_ "$1"; printf '%s' '(?!\()'; } grepc_c_m_repl_() { printf '%s' '.*?(?