]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc: grepc_macro_*: Remove a few false positives
authorAlejandro Colomar <alx.manpages@gmail.com>
Fri, 13 May 2022 15:12:47 +0000 (17:12 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:00 +0000 (21:29 +0100)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
bin/grepc

index 72c76772ecbfff6091a706b3ab3adf22f1a7d86b..0687095c5704c832ceb9524f77863b2747593b1c 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -185,7 +185,7 @@ grepc_macro_simple()
        grepc_helper \
          "#\s*define\s+$1\b[^(]" \
          '.' \
-         '(?s)#\s*define\s+'"$1"'\b(?!\().*?[^\\]$';
+         '(?s)^[ \t]*#\s*define\s+'"$1"'\b(?!\().*?[^\\]$';
 }
 
 
@@ -194,7 +194,7 @@ grepc_macro_func()
        grepc_helper \
          "#\s*define\s+$1\(" \
          '.' \
-         '(?s)#\s*define\s+'"$1"'\(.*?[^\\]$';
+         '(?s)^[ \t]*#\s*define\s+'"$1"'\(.*?[^\\]$';
 }