diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:24:40 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:24:41 -0700 |
commit | 423a9e28fc144624437cb00ce853b741891ae623 (patch) | |
tree | 122813b166013c768daa1a0c011300cd84f74133 /git-send-email.perl | |
parent | 5f9d8e3572e507fec9047fbfc216821d23b42881 (diff) | |
parent | b622d4d11d27fd290f7732c6a65f40c054796c1f (diff) | |
download | git-423a9e28fc144624437cb00ce853b741891ae623.tar.gz |
Merge branch 'tr/maint-send-email-2047' into maint-1.7.11
"git send-email" did not unquote encoded words that appear on the
header correctly, and lost "_" from strings.
* tr/maint-send-email-2047:
send-email: improve RFC2047 quote parsing
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index ef30c557c7..664713709c 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -862,11 +862,13 @@ $time = time - scalar $#files; sub unquote_rfc2047 { local ($_) = @_; my $encoding; - if (s/=\?([^?]+)\?q\?(.*)\?=/$2/g) { + s{=\?([^?]+)\?q\?(.*?)\?=}{ $encoding = $1; - s/_/ /g; - s/=([0-9A-F]{2})/chr(hex($1))/eg; - } + my $e = $2; + $e =~ s/_/ /g; + $e =~ s/=([0-9A-F]{2})/chr(hex($1))/eg; + $e; + }eg; return wantarray ? ($_, $encoding) : $_; } |