]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

* Fix line number display for config file parse errors.
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 14 Oct 2007 23:06:41 +0000 (19:06 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 14 Oct 2007 23:06:41 +0000 (19:06 -0400)
debian/changelog
mr

index 767966aa4fc732361a3116772836e39030fb3568..a6e1e9b54b7f8315cdaa3c201fc6d3c5056ce8ce 100644 (file)
@@ -1,3 +1,9 @@
+mr (0.2) UNRELEASED; urgency=low
+
+  * Fix line number display for config file parse errors.
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 14 Oct 2007 19:03:22 -0400
+
 mr (0.1) unstable; urgency=low
 
   * First release.
 mr (0.1) unstable; urgency=low
 
   * First release.
diff --git a/mr b/mr
index f725318b0dfea0f69f67d57a4ed25a8123245a8f..11d1c2beb9874c310d2178d188f71b270775468e 100755 (executable)
--- a/mr
+++ b/mr
@@ -527,8 +527,10 @@ sub loadconfig { #{{{
        close $in;
 
        my $section;
        close $in;
 
        my $section;
+       my $line=0;
        while (@lines) {
                $_=shift @lines;
        while (@lines) {
                $_=shift @lines;
+               $line++;
                chomp;
                next if /^\s*\#/ || /^\s*$/;
                if (/^\[([^\]]*)\]\s*$/) {
                chomp;
                next if /^\s*\#/ || /^\s*$/;
                if (/^\[([^\]]*)\]\s*$/) {
@@ -541,6 +543,7 @@ sub loadconfig { #{{{
                        # continued value
                        while (@lines && $lines[0]=~/^\s(.+)/) {
                                shift(@lines);
                        # continued value
                        while (@lines && $lines[0]=~/^\s(.+)/) {
                                shift(@lines);
+                               $line++;
                                $value.="\n$1";
                                chomp $value;
                        }
                                $value.="\n$1";
                                chomp $value;
                        }
@@ -572,7 +575,7 @@ sub loadconfig { #{{{
                        }
                }
                else {
                        }
                }
                else {
-                       die "$f line $.: parse error\n";
+                       die "$f line $line: parse error\n";
                }
        }
 
                }
        }