summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstr\xf6m <john@ankarstrom.se>2021-06-03 01:00:27 +0200
committerJohn Ankarstr\xf6m <john@ankarstrom.se>2021-06-03 01:00:27 +0200
commit54651e45454c93ffc4da9542c2b950f2d7599de5 (patch)
tree6350334f96d77258301a433c5cee076446c9b380
parent368ad7a138daf6f15a2be2a8ef3546f30f643d47 (diff)
downloadref-54651e45454c93ffc4da9542c2b950f2d7599de5.tar.gz
re: Chomp lines before matching them
-rwxr-xr-xre3
1 files changed, 2 insertions, 1 deletions
diff --git a/re b/re
index cd373aa..415de0f 100755
--- a/re
+++ b/re
@@ -65,11 +65,12 @@ for (@references) {
local $_;
while ($_ = readline $handles{$file}) {
$lines{$file}++;
+ chomp;
if ($rx->match($_)) {
$loc = $bytes{$file};
last;
}
- $bytes{$file} += length($_);
+ $bytes{$file} += length($_)+1;
}
} else {
goto invalid;