Skip to content

Commit 1b67bef

Browse files
author
Eric Wong
committed
git-svn: cleanup sprintf usage for uppercasing hex
We do not need to call uc() separately for sprintf("%x") as sprintf("%X") is available. Signed-off-by: Eric Wong <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]>
1 parent ec3ae6e commit 1b67bef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

perl/Git/SVN.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ sub refname {
490490
#
491491
# Additionally, % must be escaped because it is used for escaping
492492
# and we want our escaped refname to be reversible
493-
$refname =~ s{([ \%~\^:\?\*\[\t])}{uc sprintf('%%%02x',ord($1))}eg;
493+
$refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
494494

495495
# no slash-separated component can begin with a dot .
496496
# /.* becomes /%2E*
@@ -2377,7 +2377,7 @@ sub map_path {
23772377

23782378
sub uri_encode {
23792379
my ($f) = @_;
2380-
$f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#uc sprintf("%%%02x",ord($1))#eg;
2380+
$f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#sprintf("%%%02X",ord($1))#eg;
23812381
$f
23822382
}
23832383

perl/Git/SVN/Editor.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ sub url_path {
146146
my ($self, $path) = @_;
147147
if ($self->{url} =~ m#^https?://#) {
148148
# characters are taken from subversion/libsvn_subr/path.c
149-
$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#uc sprintf("%%%02x",ord($1))#eg;
149+
$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf("%%%02X",ord($1))#eg;
150150
}
151151
$self->{url} . '/' . $self->repo_path($path);
152152
}

0 commit comments

Comments
 (0)