diff options
author | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2012-01-28 13:14:02 +0000 |
---|---|---|
committer | rmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d> | 2012-01-28 13:14:02 +0000 |
commit | 7d48ec10a3a13b12e5bafba199b27307e9d38c7c (patch) | |
tree | 3fc4c39d855abd9341b5fd97da2c896e717d7f4d | |
parent | 7bbafe5434e6634e2e1b3d3126e0445de217d8b2 (diff) |
Make sure $file starts with a letter to avoid regexp warning in /\b$file/.
git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@115 2592e710-e01b-42a5-8df0-11608a6cc53d
-rw-r--r-- | mcon/pl/lint.pl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mcon/pl/lint.pl b/mcon/pl/lint.pl index 1e435bf..1e4cad3 100644 --- a/mcon/pl/lint.pl +++ b/mcon/pl/lint.pl @@ -812,8 +812,10 @@ sub p_body { # Record file as used. Later on, we will make sure we had the right # to use that file: either we are in the unit that defines it, or we # include the unit that creates it in our dependencies, relying on ?F:. - $fileused{$unit} .= "$file " unless - $filetmp{$file} || $fileused{$unit} =~ /\b$file\b/; + if ($file =~ /^\w/) { + $fileused{$unit} .= "$file " unless + $filetmp{$file} || $fileused{$unit} =~ /\b$file\b/; + } # Mark temporary file as being used, to spot useless local declarations $filetmp{$file} .= ' used' if defined $filetmp{$file} && $filetmp{$file} !~ /\bused/; @@ -827,8 +829,10 @@ sub p_body { s!(if|\|\||&&)\s+([^\$/`\s;]+)\s*!: ! # if prog, || prog, && prog ) { $file = $2; - $filemisused{$unit} .= "$file " unless - $filetmp{$file} || $filemisused{$unit} =~ /\b$file\b/; + if ($file =~ /^\w/) { + $filemisused{$unit} .= "$file " unless + $filetmp{$file} || $filemisused{$unit} =~ /\b$file\b/; + } # Temporary files should be used with ./ anyway $filetmp{$file} .= ' misused' if defined $filetmp{$file} && $filetmp{$file} !~ /\bmisused/; |