checkpatch: Fix unescaped left brace
PATCH 1/1 checkpatch: Fix unescaped left brace
There is an unescaped left brace in a regex in OPEN_BRACE check. This throws a runtime error when checkpatch is run with --fix flag and the OPEN_BRACE check is executed.
Fix it by escaping the left brace.
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -4505,7 +4505,7 @@ sub process { $fix) { fix_delete_line($fixlinenr, $rawline); my $fixed_line = $rawline; - $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; my $line1 = $1; my $line2 = $2; fix_insert_line($fixlinenr, ltrim($line1));
Signature · 6 lines
2.27.0 _______________________________________________ Linux-kernel-mentees mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 7 lines · Dwaipayan Ray
There is an unescaped left brace in a regex in
OPEN_BRACEcheck. This throws a runtime error when checkpatch is run with --fix flag and theOPEN_BRACEcheck is executed.Fix it by escaping the left brace.
Can you find with 'git blame' which commit introduced this issue and add a Fixes: tag?
Other than that, it looks good.
Lukas
Quoted 19 lines
Signed-off-by Dwaipayan Ray <[email protected]>--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/checkpatch.pl +1
-2@@ -4505,7 +4505,7 @@ sub process { $fix) { fix_delete_line($fixlinenr, $rawline); my $fixed_line = $rawline; - $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; my $line1 = $1; my $line2 = $2; fix_insert_line($fixlinenr, ltrim($line1)); --
Quoted 2 lines
2.27.0
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 7 lines · Lukas Bulwahn
Quoted 5 lines · Dwaipayan Ray
There is an unescaped left brace in a regex in
OPEN_BRACEcheck. This throws a runtime error when checkpatch is run with --fix flag and theOPEN_BRACEcheck is executed.
Quoted 7 lines
Quoted 2 lines
Fix it by escaping the left brace.
Can you find with 'git blame' which commit introduced this issue and add a Fixes: tag?
Other than that, it looks good.
Apparently it was introduced back in 2014 when it was first written by commit 8d1824780f2f. I guess perl depreciated allowing unescaped left braces at some point.
I will add that and send it off.
Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees