From ec19c4344d75df46681d8fd0d1379e8bf4a1d091 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Oct 2007 19:06:41 -0400 Subject: [PATCH] * Fix line number display for config file parse errors. --- debian/changelog | 6 ++++++ mr | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 767966a..a6e1e9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mr (0.2) UNRELEASED; urgency=low + + * Fix line number display for config file parse errors. + + -- Joey Hess Sun, 14 Oct 2007 19:03:22 -0400 + mr (0.1) unstable; urgency=low * First release. diff --git a/mr b/mr index f725318..11d1c2b 100755 --- a/mr +++ b/mr @@ -527,8 +527,10 @@ sub loadconfig { #{{{ close $in; my $section; + my $line=0; while (@lines) { $_=shift @lines; + $line++; chomp; next if /^\s*\#/ || /^\s*$/; if (/^\[([^\]]*)\]\s*$/) { @@ -541,6 +543,7 @@ sub loadconfig { #{{{ # continued value while (@lines && $lines[0]=~/^\s(.+)/) { shift(@lines); + $line++; $value.="\n$1"; chomp $value; } @@ -572,7 +575,7 @@ sub loadconfig { #{{{ } } else { - die "$f line $.: parse error\n"; + die "$f line $line: parse error\n"; } } -- 2.39.5