From 200ee0d2041b137038d9cc1c168e0d4a74cc8d96 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 1 Sep 2021 11:59:54 +0200 Subject: [PATCH] style: better support if statement with initializer * tests/sanity/style.test: Here. --- tests/sanity/style.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/style.test b/tests/sanity/style.test index f181c747e..29fe48aea 100755 --- a/tests/sanity/style.test +++ b/tests/sanity/style.test @@ -164,7 +164,7 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do $GREP '[ ]if ([^()]*([^()]*)[^()]*).*;' $tmp && diag 'if body should be on another line.' - $GREP '[ ]else.*;' $tmp && + $GREP -E '[ ]else.*;(|.*}.*)$' $tmp && diag 'else body should be on another line.' $GREP '[ ]while(' $tmp &&