]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Git::unquote_path(): handle '\a'
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Fri, 30 Jun 2017 09:49:10 +0000 (10:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Jun 2017 15:02:43 +0000 (08:02 -0700)
unquote_path() does not handle quoted paths containing '\a',
even though quote.c::unquote_c_style() does, and quote.c:sq_lookup[]
tells quote.c::sq_must_quote() that '\007' must be quoted as '\a'.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
perl/Git.pm

index cf7a7e6a516c4a2802908dd8ce7971fc52bb7e30..3179e6efb29a1a88df8f90aa458fbe5f9a41d419 100644 (file)
@@ -1461,6 +1461,7 @@ when not using -z or when parsing the output of diff -u.
 
 {
        my %cquote_map = (
+               "a" => chr(7),
                "b" => chr(8),
                "t" => chr(9),
                "n" => chr(10),
@@ -1487,7 +1488,7 @@ when not using -z or when parsing the output of diff -u.
                                        $_ = $2;
                                        last;
                                }
-                               if (/^([\\\042btnvfr])(.*)$/) {
+                               if (/^([\\\042abtnvfr])(.*)$/) {
                                        $retval .= $cquote_map{$1};
                                        $_ = $2;
                                        last;