diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2016-03-15 14:58:09 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-01-18 08:45:02 +0100 |
commit | 731909c0b4fc98e9492d3a9e3f8bbaa56d457623 (patch) | |
tree | e57f796e5ccd66609971a95cd390cbf350436d17 | |
parent | aef5d05100a5e4aed13bb1586bf154ff602ab961 (diff) | |
download | barebox-731909c0b4fc98e9492d3a9e3f8bbaa56d457623.tar.gz barebox-731909c0b4fc98e9492d3a9e3f8bbaa56d457623.tar.xz |
checkpatch: fix another left brace warning
This patch escapes a regex that uses left brace.
Using checkpatch.pl with Perl 5.22.0 generates the warning: "Unescaped
left brace in regex is deprecated, passed through in regex;"
Comment from regcomp.c in Perl source: "Currently we don't warn when the
lbrace is at the start of a construct. This catches it in the middle of
a literal string, or when it's the first thing after something like
"\b"."
This works as a complement to 4e5d56bd ("checkpatch: fix left brace
warning").
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f3fd3395f1..48ad4938d9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2264,7 +2264,7 @@ sub process { ## } #need space before brace following if, while, etc - if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) || + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || $line =~ /do\{/) { ERROR("space required before the open brace '{'\n" . $herecurr); } |