Change 30010 by [EMAIL PROTECTED] on 2007/01/26 14:03:34
Subject: [PATCH] Small bugfixes to uupacktool.pl
From: "Jos Boumans" <[EMAIL PROTECTED]>
Date: Fri, 26 Jan 2007 14:50:29 +0100 (CET)
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/uupacktool.pl#2 edit
Differences ...
==== //depot/perl/uupacktool.pl#2 (text) ====
Index: perl/uupacktool.pl
--- perl/uupacktool.pl#1~29604~ 2006-12-20 08:13:32.000000000 -0800
+++ perl/uupacktool.pl 2007-01-26 06:03:34.000000000 -0800
@@ -5,6 +5,8 @@
use Getopt::Long;
use File::Basename;
+Getopt::Long::Configure('no_ignore_case');
+
our $LastUpdate = -M $0;
sub handle_file {
@@ -27,7 +29,7 @@
}
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 @@
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 @@
}
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'};
End of Patch.