Skip to content

Commit

Permalink
Avoid undefined value warnings when trying to tab-complete
Browse files Browse the repository at this point in the history
nothingness.  dreamer on irc.perl.org #poe reported the problem, with
a useful test case.
  • Loading branch information
rcaputo committed Mar 9, 2010
1 parent 2ea0337 commit a76320c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/POE/Wheel/ReadLine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ sub _complete_match {
my ($self) = @_;
my $lookfor = substr($self->[SELF_INPUT], 0, $self->[SELF_CURSOR_INPUT]);
$lookfor =~ /(\S+)$/;
$lookfor = $1;
$lookfor = defined($1) ? $1 : "";
my $point = $self->[SELF_CURSOR_INPUT] - length($lookfor);

my @clist = ();
Expand Down Expand Up @@ -2281,7 +2281,7 @@ sub rl_complete {

my $lookfor = substr($self->[SELF_INPUT], 0, $self->[SELF_CURSOR_INPUT]);
$lookfor =~ /(\S+)$/;
$lookfor = $1;
$lookfor = defined($1) ? $1 : "";
my $point = $self->[SELF_CURSOR_INPUT] - length($lookfor);
my @poss = $self->_complete_match;
if (scalar @poss == 0) {
Expand Down

0 comments on commit a76320c

Please sign in to comment.