Subject: | List method don't with default options |
the problem is that the default value for -files option is '.' ... and this don't work for the List method, forcing the user to pass -file=>[] for this method to work, which does not seem the intented.
the patch threat this exception, and fix a misplaced 'if' statment that would cause a warning (perl -w)
--- Rar-1.9.pm Fri Jan 3 09:53:08 2003
+++ Rar.pm Fri Jan 3 10:19:18 2003
@@ -203,11 +203,11 @@ sub SetOptions {
while (($clef,$valeur) =each(%params)) {
$args{$clef} =$valeur;
}
$me->{current} =\%args;
- $args{'-files'} ='.' if (IsEmpty($args{'-files'}));
+ $args{'-files'} =$command eq 'vt' ? [] : '.' if (IsEmpty($args{'-files'}));
$args{'-files'} =[ $args{'-files'} ] if (ref($args{'-files'}) eq '');
$me->{archive} =$args{'-archive'} if (!IsEmpty($args{'-archive'}));
# print "ARCHIVE='$me->{archive}' '$args->{-archive}'\n";
if (defined $me->{archive} && $me->{archive} ne '') {
@@ -297,12 +297,12 @@ Fin:
# ----------------------------------------------------------------
#
#
sub _AddToList {
my ($me,$pcurrfile,$pattrib) =@_;
- return if ($pattrib->[6] =~ /d/i);
return if ($#$pattrib < 0);
+ return if ($pattrib->[6] =~ /d/i);
$me->{list} =() if (!defined $me->{list});
if ($pattrib->[3] =~ /(^<->$)|(^<--$)/) {
$pcurrfile->{packed} +=$pattrib->[2];
$pcurrfile->{parts}++;
} else {