aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-03-02 17:18:34 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-03-02 17:18:34 +0000
commit1e425a1d667f8c7fa176e4cc427bb4bd4f483f6b (patch)
tree58b83662f61206cb4db2c9b6d7a6342106bfc508 /tools
parent6db5c9387bacc520b143cb16f291bf6f5e26ca1a (diff)
As suggested by Anders: when we detect non-ASCII characters, print the line
number on which we found them. svn path=/trunk/; revision=36122
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 02aa4d13a5..6b1f0c22a5 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1280,6 +1280,7 @@ while ($_ = $ARGV[0])
my $filename = $_;
my $fileContents = '';
my @foundAPIs = ();
+ my $line;
die "No such file: \"$filename\"" if (! -e $filename);
@@ -1288,14 +1289,16 @@ while ($_ = $ARGV[0])
# Read in the file (ouch, but it's easier that way)
open(FC, $filename) || die("Couldn't open $filename");
- while (<FC>) { $fileContents .= $_; }
- close(FC);
-
- if ($fileContents =~ m{ [\x80-\xFF] }xo)
- {
- print STDERR "Error: Found non-ASCII characters in " .$filename."\n";
- $errorCount++;
+ $line = 1;
+ while (<FC>) {
+ $fileContents .= $_;
+ if ($_ =~ m{ [\x80-\xFF] }xo) {
+ print STDERR "Error: Found non-ASCII characters on line " .$line. " of " .$filename."\n";
+ $errorCount++;
+ }
+ $line++;
}
+ close(FC);
if ($fileContents =~ m{ %ll }xo)
{