utf8: release strbuf on error return in strbuf_utf8_replace()
[gitweb.git] / perl / Git.pm
index cf7a7e6a516c4a2802908dd8ce7971fc52bb7e30..ffa09ace924e0a7b079d039e905363435b08cf9b 100644 (file)
@@ -532,7 +532,7 @@ sub version {
 =cut
 
 sub get_tz_offset {
-       # some systmes don't handle or mishandle %z, so be creative.
+       # some systems don't handle or mishandle %z, so be creative.
        my $t = shift || time;
        my $gm = timegm(localtime($t));
        my $sign = qw( + + - )[ $gm <=> $t ];
@@ -1461,6 +1461,7 @@ sub prefix_lines {
 
 {
        my %cquote_map = (
+               "a" => chr(7),
                "b" => chr(8),
                "t" => chr(9),
                "n" => chr(10),
@@ -1487,13 +1488,13 @@ sub prefix_lines {
                                        $_ = $2;
                                        last;
                                }
-                               if (/^([\\\042btnvfr])(.*)$/) {
+                               if (/^([\\\042abtnvfr])(.*)$/) {
                                        $retval .= $cquote_map{$1};
                                        $_ = $2;
                                        last;
                                }
-                               # This is malformed -- just return it as-is for now.
-                               return $_[0];
+                               # This is malformed
+                               throw Error::Simple("invalid quoted path $_[0]");
                        }
                        $_ = $remainder;
                }