X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=contrib%2Frestore.pl;h=98ae277d17e2203879149f9b19c3f436f8eb4a74;hb=260aaf269765b6fdf0c74ec51615e38a70b27fa3;hp=f9c55ce06320dbe63e7434661819a59ae3e7ac12;hpb=ab51d5778a1f19c204c935de231737df2e62c20c;p=cumulus.git diff --git a/contrib/restore.pl b/contrib/restore.pl index f9c55ce..98ae277 100755 --- a/contrib/restore.pl +++ b/contrib/restore.pl @@ -128,7 +128,7 @@ sub load_ref { my $object_size = length $contents; my ($start, $length); - if ($1 ne "") { + if (defined($1)) { ($start, $length) = ($2 + 0, $3 + 0); } else { ($start, $length) = (0, $3 + 0); @@ -359,7 +359,7 @@ sub process_metadata { # Try to parse the data as "key: value" pairs of file metadata. Also # handle continuation lines, which start with whitespace and continue # the previous "key: value" pair. - if ($line =~ m/^(\w+):\s*(.*)$/) { + if ($line =~ m/^([-\w]+):\s*(.*)$/) { $info{$1} = $2; $last_key = $1; } elsif ($line =~/^\s/ && defined $last_key) { @@ -409,7 +409,7 @@ while (defined($line = )) { # lines. chomp $line; - if ($line =~ m/^(\w+):\s*(.*)$/) { + if ($line =~ m/^([-\w]+):\s*(.*)$/) { $descriptor{$1} = $2; $last_key = $1; } elsif ($line =~/^\s/ && defined $last_key) {