correct argument handling in Term::ReadLine
authorRicardo Signes <rjbs@cpan.org>
Wed, 14 Mar 2012 20:46:21 +0000 (16:46 -0400)
committerRicardo Signes <rjbs@cpan.org>
Thu, 15 Mar 2012 13:33:58 +0000 (09:33 -0400)
https://rt.perl.org/rt3/Ticket/Display.html?id=111758

patch by Darin McBride

dist/Term-ReadLine/lib/Term/ReadLine.pm

index f1b1419..3770df0 100644 (file)
@@ -454,7 +454,7 @@ sub event_loop {
 
     # store the callback in toloop, again so that other modules will
     # recognise it and call us for the loop.
-    $Term::ReadLine::toloop = [ @_ ] if @_ > 1;
+    $Term::ReadLine::toloop = [ @_ ] if @_ > 0; # 0 because we shifted off $self.
     $Term::ReadLine::toloop;
 }