]> Devi Nivas Git - cs3210-lab0.git/commitdiff
correct line numbers
authorrsc <rsc>
Fri, 10 Aug 2007 17:45:14 +0000 (17:45 +0000)
committerrsc <rsc>
Fri, 10 Aug 2007 17:45:14 +0000 (17:45 +0000)
runoff1

diff --git a/runoff1 b/runoff1
index 68e4565c516490878887c91aa04a49bacd024434..381a67feeb51a7d7b5d9d73e0748f55c5be43f42 100755 (executable)
--- a/runoff1
+++ b/runoff1
@@ -13,12 +13,15 @@ if($ARGV[0] eq "-n") {
 }
 $n = int(($n+49)/50)*50 - 1;
 
+$file = $ARGV[0];
 @lines = <>;
+$linenum = 0;
 foreach (@lines) {
+       $linenum++;
        chomp;
        s/\s+$//;
        if(length() >= 75){
-               print "$ARGV[0]:$.: line too long";
+               print STDERR "$file:$linenum: line too long\n";
        }
 }
 @outlines = ();