]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc: grepc_enum_constant, grepc_type_typedef_simple: Remove a few false positives
authorAlejandro Colomar <alx.manpages@gmail.com>
Mon, 9 May 2022 11:51:52 +0000 (13:51 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:28:50 +0000 (21:28 +0100)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
bin/grepc

index db75520b9fd4e0be42eb5228f30d0bece6760b10..7e76e98021d94d64682a2864c195e8db7a842852 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -44,8 +44,8 @@ function grepc_macro()
 function grepc_enum_constant()
 {
        grepc_helper '\.[ch]$' \
-         "\b$1\s*[,=]" \
-         "(?s)\benum\b\s*[\w\s[\]]*{[^}]*\b$1\s*[=,].*?^}.*?;";
+         "^\s*$1\s*[,=]" \
+         "(?s)\benum\b\s*[\w\s[\]]*{[^}]*^\s*$1\s*[=,].*?^}.*?;";
 }
 
 
@@ -119,7 +119,7 @@ function grepc_type_typedef_simple()
 {
        grepc_helper '\.[ch]$' \
          "\b$1;" \
-         "(?s)^typedef\s+[^;]+$1;";
+         "(?s)^typedef\s+[^{};]+$1;";
 }