summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-05-10 19:09:40 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-05-10 19:09:40 +0200
commit0af5965bb494182b64054fdc8e2c5cc0d68f28e8 (patch)
tree9efc75f6cc1c5f4fd0aa73b669cf6507bbdfa3ee /bin
parent1046cdc35161fb7b9b07bd5f572704fd3d9b5243 (diff)
grepc: Remove spurious blank lines
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/grepc14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/grepc b/bin/grepc
index 9f6f1ff..72af103 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -57,8 +57,8 @@ function grepc_enum_constant()
{
grepc_helper \
'^enum\s' \
- "^\s*$1\s*[,=]" \
- "(?s)\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^\s*$1\s*[=,].*?^}.*?;";
+ "^[ \t]*$1\s*[,=]" \
+ "(?s)\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^[ \t]*$1\s*[=,].*?^}.*?;";
}
@@ -129,25 +129,25 @@ function grepc_type_struct_union_enum()
grepc_helper \
"\b(struct|union|enum)\s+$1\b" \
'.' \
- "(?s)^(?!^\s*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union|enum)\s+$1\b\s*[\w\s[\]]*{.*?^}.*?;";
+ "(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union|enum)\s+$1\b\s*[\w\s[\]]*{.*?^}.*?;";
}
function grepc_type_typedef_simple()
{
grepc_helper \
- '^\s*typedef\s' \
+ '^[ \t]*typedef\s' \
"\b$1;" \
- "(?s)^\s*typedef\s+[^{};]+$1;";
+ "(?s)^[ \t]*typedef\s+[^{};]+$1;";
}
function grepc_type_typedef_struct_union_enum()
{
grepc_helper \
- '^\s*typedef\s+(struct|union|enum)\b[^;]*$' \
+ '^[ \t]*typedef\s+(struct|union|enum)\b[^;]*$' \
"^( )?}\s*$1;" \
- "(?s)^\s*typedef\s+(struct|union|enum)\s+(?:(?!^( )?}|^\s*typedef).)*^( )?}\s*$1;";
+ "(?s)^[ \t]*typedef\s+(struct|union|enum)\s+(?:(?!^( )?}|^\s*typedef).)*^( )?}\s*$1;";
}