lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] checkpatch: complain about GW-BASIC style label names
From
Date
On Thu, 2015-05-07 at 13:17 -0700, Joe Perches wrote:
> # check for label names likely used in a numeric sequence of labels
> if ($line =~ /^.\s*((?:err|error|fail|out)[0-9+])\s*:/i ||
> $line =~ /\bgoto\s+((?:err|error|fail|out)[0-9+])\s*[:;,]/) {

Meh. I told you about my perl-fu...

That + should be outside the close bracket and it's probably
better that this use a funny (?i) use inside the capture group
so that the goto is lower case only, but the label can be
lower, upper and mixed case.

if ($line =~ /^.\s*((?i)(?:err|error|fail|out)[0-9]+)\s*:/ ||
$line =~ /\bgoto\s+((?i)(?:err|error|fail|out)[0-9]+)\s*[:;,]/) {




\
 
 \ /
  Last update: 2015-05-07 23:01    [W:0.082 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site