From 54651e45454c93ffc4da9542c2b950f2d7599de5 Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Thu, 3 Jun 2021 01:00:27 +0200 Subject: re: Chomp lines before matching them --- re | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 're') 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; -- cgit v1.2.3