X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=uupacktool.pl;h=9872a9e94eb72ce3abe87429a72f1ed272879358;hb=5b6782b28b8a9d505447276bdd3de3a802f641dd;hp=5656cefb0d991a1879d876c256e3cb49e8c38cae;hpb=1266ad8f485f435b89a025d0463af17ae6a66f3c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/uupacktool.pl b/uupacktool.pl index 5656cef..9872a9e 100644 --- a/uupacktool.pl +++ b/uupacktool.pl @@ -5,6 +5,8 @@ use warnings; use Getopt::Long; use File::Basename; +Getopt::Long::Configure('no_ignore_case'); + our $LastUpdate = -M $0; sub handle_file { @@ -27,7 +29,7 @@ sub handle_file { } my ($head, $body) = split /__UU__\n/, $str; die "Can't unpack malformed data in '$file'\n" - if !$head or !$body; + if !$head; $outstr = unpack 'u', $body; } else { @@ -62,7 +64,8 @@ EOFBLURB open my $outfh, ">", $outfile or die "Could not open $outfile for writing: $!"; binmode $outfh; - print $outfh $outstr; + ### $outstr might be empty, if the file was empty + print $outfh $outstr if $outstr; close $outfh; chmod $mode, $outfile; @@ -156,7 +159,7 @@ Options: } my $opts = {}; -GetOptions($opts,'u','p','c','m:s','s','d=s','v','h'); +GetOptions($opts,'u','p','c', 'D', 'm:s','s','d=s','v','h'); die "Can't pack and unpack at the same time!\n", usage() if $opts->{'u'} && $opts->{'p'};