From: Alejandro Colomar Date: Sat, 14 May 2022 22:52:03 +0000 (+0200) Subject: grepc: grepc_enum_constant: Fix edge cases X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6385eaeb603b858d9f60cd38847861539126575e;p=thirdparty%2Fman-pages.git grepc: grepc_enum_constant: Fix edge cases Most importantly, typedef enum. Signed-off-by: Alejandro Colomar --- diff --git a/bin/grepc b/bin/grepc index 80def6143..173cf2b93 100755 --- a/bin/grepc +++ b/bin/grepc @@ -119,9 +119,9 @@ grepc_helper() grepc_enum_constant() { grepc_helper \ - '^enum\s' \ - "^[ \t]*$1\s*[,=]" \ - "(?s)\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^[ \t]*$1\s*[=,].*?^}.*?;"; + '\benum\b' \ + "^[ \t]*$1\b\s*[,=]" \ + "(?s)^([\w[]+[\w\s]*)?\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^[ \t]*$1\b\s*[=,].*?^}.*?;"; }