]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc: grepc_type_typedef_underlying_struct_union_enum: Don't duplicate output
authorAlejandro Colomar <alx.manpages@gmail.com>
Sun, 8 May 2022 22:37:18 +0000 (00:37 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:28:48 +0000 (21:28 +0100)
In typedefs of the form 'typedef struct foo foo;', don't print the
structure twice.

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

index c03cbf2fd20fb3152b7220f7eb11e9cb085e6b25..5c53af00eca15a3dc41aa9f700b83d76baa56889 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -151,7 +151,8 @@ function grepc_type_typedef_underlying_struct_union_enum()
        | sed -E -e 's/^typedef\s+//' -e "s/\s*\**\b$1;.*//" \
        | sed -E -e 's/^struct\s+//' -e 's/^union\s+//' -e 's/^enum\s+//' \
        | while read t; do
-               grepc_type_struct_union_enum "$t";
+               test "$1" != "$t" \
+               && grepc_type_struct_union_enum "$t";
        done;
 }