From: Michael Vrable Date: Sat, 12 May 2007 17:21:23 +0000 (-0700) Subject: Add in decoding (URI-style, %xx) of filenames to reference decoder. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=fd58e0c9a15cf28adaf545adc31b3d5531c9f899;p=cumulus.git Add in decoding (URI-style, %xx) of filenames to reference decoder. --- diff --git a/restore.pl b/restore.pl index ef7a3df..1322e1e 100755 --- a/restore.pl +++ b/restore.pl @@ -134,6 +134,12 @@ sub load_ref { # iterate_objects is a helper function used to iterate over the set of object # references that contain the file data for a regular file. +sub uri_decode { + my $str = shift; + $str =~ s/%([0-9a-f]{2})/chr(hex($1))/ge; + return $str; +} + sub iterate_objects { my $callback = shift; # Function to be called for each reference my $arg = shift; # Argument passed to callback @@ -173,7 +179,7 @@ sub process_file { my %info = @_; # TODO - print "process_file: ", $info{name}, "\n"; + print "process_file: ", uri_decode($info{name}), "\n"; if (defined $info{data}) { my $verifier = verifier_create($info{checksum});