lwp-request bug
David Mankin (mankin@www.students.rhodes.edu)
Thu, 3 Jul 1997 12:17:57 -0500
I have found a very small bug in lwp-request v. 1.26 (in libwww-perl-5.10,
the latest on CPAN). Below are the changes that should be made.
The problem is this: when setting a timeout with the -t flag, if no
suffix is given on the time, such as s, m, or h, then it produces this
annoying warning message under perl 5.004:
Use of uninitialized value at /usr/local/bin/lwp-request line 316.
Use of uninitialized value at /usr/local/bin/lwp-request line 317.
I am not subscribed to this mailing list, so please cc: followup messages
to me. I've also never posted a patch, so I hope this is the right format.
-David Mankin
mankin@www.students.rhodes.edu
*** lwp-request Wed Jun 11 17:01:55 1997
--- lwp-request Thu Jul 3 11:53:12 1997
***************
*** 313,320 ****
$opt_t =~ /^(\d+)([smh])?/;
die "$0: Illegal timeout value!\n" unless defined $1;
$timeout = $1;
! $timeout *= 60 if ($2 eq "m");
! $timeout *= 3600 if ($2 eq "h");
$ua->timeout($timeout);
}
--- 313,320 ----
$opt_t =~ /^(\d+)([smh])?/;
die "$0: Illegal timeout value!\n" unless defined $1;
$timeout = $1;
! $timeout *= 60 if (defined $2 && $2 eq "m");
! $timeout *= 3600 if (defined $2 && $2 eq "h");
$ua->timeout($timeout);
}