]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc: Fix some corner cases
authorAlejandro Colomar <alx.manpages@gmail.com>
Mon, 9 May 2022 22:59:06 +0000 (00:59 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:28:53 +0000 (21:28 +0100)
Those two spaces are for handling some insane GNU style.  Those
are always spaces, so let's use '  ' instead of '\s\s' to make
sure we don't match two tabs, or things like that.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
bin/grepc

index e7dd99ab95e43f42a8ee35fc94659341c4180840..c294a92b1b37f0553d7d0693fcee58bd76afb3ab 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -137,8 +137,8 @@ function grepc_type_typedef_struct_union_enum()
 {
        grepc_helper '\.[ch]$' \
          '^\s*typedef\s+(struct|union|enum)\b[^;]*$' \
-         "^(\s\s)?}\s*$1;" \
-         "(?s)^\s*typedef\s+(struct|union|enum)\s+(?:(?!^(\s\s)?}|^\s*typedef).)*^(\s\s)?}\s*$1;";
+         "^(  )?}\s*$1;" \
+         "(?s)^\s*typedef\s+(struct|union|enum)\s+(?:(?!^(  )?}|^\s*typedef).)*^(  )?}\s*$1;";
 }