]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc: grepc_type_struct_union_enum: Don't duplicate output
authorAlejandro Colomar <alx.manpages@gmail.com>
Mon, 9 May 2022 11:38:43 +0000 (13:38 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:28:50 +0000 (21:28 +0100)
In definitions of the form

typedef struct foo {...} foo;

grepc_type_typedef_struct_union_enum() is already finding it.
Remove the duplicate here.

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

index 4d6c430fd2129c4d2ec5aa1b3820687aed12a4d5..1f7c3076bd0ca640885390cb614534f286f308fa 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -111,7 +111,7 @@ function grepc_type_struct_union_enum()
 {
        grepc_helper '\.[ch]$' \
          "\b(struct|union|enum)\s+$1\b" \
-         "(?s)^([\w[][\w\s(,)[:\]*]+\s+)?\b(struct|union|enum)\s+$1\b\s*[\w\s[\]]*{.*?^}.*?;";
+         "(?s)^(?!^typedef\b)([\w[][\w\s(,)[:\]*]+\s+)?\b(struct|union|enum)\s+$1\b\s*[\w\s[\]]*{.*?^}.*?;";
 }