aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-05-09 00:37:18 +0200
committerAlejandro Colomar <alx@kernel.org>2025-10-29 21:28:48 +0100
commit028e926879191aca7d7f563d22aae2b5917bd8a2 (patch)
tree230d92dc114536dfea0c645fd3cad2eccaaf1e00
parentb8c9b7209e02a135d5e1e102a8ace60a70e45dba (diff)
downloadman-pages-028e926879191aca7d7f563d22aae2b5917bd8a2.tar.gz
grepc: grepc_type_typedef_underlying_struct_union_enum: Don't duplicate output
In typedefs of the form 'typedef struct foo foo;', don't print the structure twice. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rwxr-xr-xbin/grepc3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/grepc b/bin/grepc
index c03cbf2fd2..5c53af00ec 100755
--- 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;
}