X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=contrib%2Frestore.pl;fp=contrib%2Frestore.pl;h=96cf4b47442d8efc2f56e630431f566dca3c01f0;hb=d3c10b747ecec0acc14863fc12db9661c3f88128;hp=0c7ee21e408bdf8196304303c1e6f12d57ad3dc6;hpb=020917702127ad12881c8868bb649a685c561def;p=cumulus.git diff --git a/contrib/restore.pl b/contrib/restore.pl index 0c7ee21..96cf4b4 100755 --- a/contrib/restore.pl +++ b/contrib/restore.pl @@ -85,11 +85,16 @@ sub verifier_check { # necessary integrity checks (if a checksum is included), and return the object # data. sub load_ref { - # First, try to parse the object reference string into constituent pieces. - # The format is segment/object(checksum)[range]. Both the checksum and - # range are optional. my $ref_str = shift; + # Check for special objects before attempting general parsing. + if ($ref_str =~ m/^zero\[(\d+)\+(\d+)\]$/) { + return "\0" x ($2 + 0); + } + + # Try to parse the object reference string into constituent pieces. The + # format is segment/object(checksum)[range]. Both the checksum and range + # are optional. if ($ref_str !~ m/^([-0-9a-f]+)\/([0-9a-f]+)(\(\S+\))?(\[\S+\])?$/) { die "Malformed object reference: $ref_str"; }