From: Joey Hess Date: Sun, 14 Oct 2007 23:06:41 +0000 (-0400) Subject: * Fix line number display for config file parse errors. X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/ec19c4344d75df46681d8fd0d1379e8bf4a1d091 * Fix line number display for config file parse errors. --- 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"; } }