summaryrefslogtreecommitdiff
path: root/runoff1
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-10 17:45:14 +0000
committerrsc <rsc>2007-08-10 17:45:14 +0000
commit8908cc9b15a67bf8180c42af06d37f476e493e54 (patch)
treeb2416957b2599b8dfcc969394b992d138ee81723 /runoff1
parent8139713c46aa63abb65d53fc237a21ffe91aa0bb (diff)
downloadxv6-labs-8908cc9b15a67bf8180c42af06d37f476e493e54.tar.gz
xv6-labs-8908cc9b15a67bf8180c42af06d37f476e493e54.tar.bz2
xv6-labs-8908cc9b15a67bf8180c42af06d37f476e493e54.zip
correct line numbers
Diffstat (limited to 'runoff1')
-rwxr-xr-xrunoff15
1 files changed, 4 insertions, 1 deletions
diff --git a/runoff1 b/runoff1
index 68e4565..381a67f 100755
--- 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 = ();