]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/grepc_c: -tt: Remove negative lookahead
authorAlejandro Colomar <alx@kernel.org>
Wed, 5 Nov 2025 22:36:07 +0000 (23:36 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 6 Nov 2025 00:43:11 +0000 (01:43 +0100)
It was useful when we had separate calls to pcre2grep(1) for each
pattern, but now that we call it once, it's fine to have overlapping
regexes.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/bin/grepc_c

index bd3adb606d169742169debbc1d5778744f150e1c..9796ba3a6ec2db953cae7c291af5e37417d28b0a 100755 (executable)
@@ -149,7 +149,7 @@ grepc_c_t_braced()      { printf '%s' '(?s)^([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\
                           grepc_c_body_;
                           echo '[^;]*;'; }
 grepc_c_t_td_simple()   { echo '(?s)^[ \t]*typedef\s+[^{};]+\b'"$1"';'; }
-grepc_c_t_td_braced()   { printf '%s' '(?s)^[ \t]*typedef\s+(struct|union|enum)\b(?:(?!\W'"$1"'\W)([\w \t[\]]|::))*';
+grepc_c_t_td_braced()   { printf '%s' '(?s)^[ \t]*typedef\s+(struct|union|enum)\b([\w \t[\]]|::)*';
                           grepc_c_body_;
                           echo '\s*'"$1"'(\[[\w\(,\)]\])*;'; }
 grepc_c_t_td_func()     { echo '(?s)^[ \t]*typedef\s+[^{};]+\(\**'"$1"'\)\s*\([^{};]+;'; }