Subject: | BUG in IO::Filter->getline |
while () condition in getline is testing boolean value of getc's return. When getc returns char '0' the condition is false and whole thing breaks.
FIX: use 'defined' to test for getc returning error.
--- Filter.pm.old 2003-11-13 18:41:32.000000000 +0100
+++ Filter.pm 2003-11-13 18:43:12.000000000 +0100
@@ -83,7 +83,7 @@
use vars qw($VERSION $RELEASE);
-$VERSION = '0.01';
+$VERSION = '0.02';
$RELEASE = 1;
use Carp;
@@ -216,7 +216,7 @@
my $line;
my $c;
- while ($c = $self->getc)
+ while (defined ($c = $self->getc))
{
$line = "" unless defined $line;
$line .= $c;