From fd58e0c9a15cf28adaf545adc31b3d5531c9f899 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Sat, 12 May 2007 10:21:23 -0700 Subject: [PATCH] Add in decoding (URI-style, %xx) of filenames to reference decoder. --- restore.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}); -- 2.20.1