Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/experimental.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-01-07 01:14:27 +0300
committerPauli <ppzgs1@gmail.com>2022-01-09 05:19:52 +0300
commitc30bc4e2093f47a37736944da548653bc08d774d (patch)
treeecce53c042e93e3ad1200eff3a3d6aced4e716e5 /util
parentd45c0e1a5e89f01d83f6059c788524e901a11604 (diff)
check-format.pl: Fix report on space before ';' and allow it after ')'
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17434)
Diffstat (limited to 'util')
-rw-r--r--util/check-format-test-negatives.c2
-rwxr-xr-xutil/check-format.pl2
2 files changed, 3 insertions, 1 deletions
diff --git a/util/check-format-test-negatives.c b/util/check-format-test-negatives.c
index 3ea792a72f..4d925572c4 100644
--- a/util/check-format-test-negatives.c
+++ b/util/check-format-test-negatives.c
@@ -70,6 +70,8 @@ int f(void) /*
;
for (i = 0; i < 1;)
;
+ for (;;) ; /* should not trigger: space before ';' */
+ lab: ; /* should not trigger: space before ';' */
#if X
if (1) /* bad style: just part of control structure depends on #if */
diff --git a/util/check-format.pl b/util/check-format.pl
index 836fe30fa9..17bdc0aa15 100755
--- a/util/check-format.pl
+++ b/util/check-format.pl
@@ -684,7 +684,7 @@ while (<>) { # loop over all lines of all input files
report("space before '$1'") if $intra_line =~ m/\s(\.|->)/; # '.' or '->' with preceding space
report("space after '$1'") if $intra_line =~ m/(\.|->)\s/; # '.' or '->' with following space
$intra_line =~ s/\-\>|\+\+|\-\-/@/g; # blind '->,', '++', and '--'
- report("space before '$2'") if $intra_line =~ m/[^:]\s+(;)/; # space before ';' but not after ':'
+ report("space before '$1'") if $intra_line =~ m/[^:)]\s+(;)/; # space before ';' but not after ':' or ')'
report("space before '$1'") if $intra_line =~ m/\s([,)\]])/; # space before ,)]
report("space after '$1'") if $intra_line =~ m/([(\[~!])\s/; # space after ([~!
report("space after '$1'") if $intra_line =~ m/(defined)\s/; # space after 'defined'