From 28374a3626f8808995e038993b0a19ab182791c2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 30 May 2013 06:34:56 -0500 Subject: better error reporting --- lib/Reply.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Reply.pm b/lib/Reply.pm index 46e1514..66ef8a4 100644 --- a/lib/Reply.pm +++ b/lib/Reply.pm @@ -104,12 +104,13 @@ sub _read { my $prompt = $self->_wrapped_plugin('prompt'); my ($line) = $self->_wrapped_plugin('read_line', $prompt); + return if !defined $line; - if (defined($line) && $line =~ s/^#(\w+)(?:\s+|$)//) { + if ($line =~ s/^#(\w+)(?:\s+|$)//) { ($line) = $self->_chained_plugin("command_\L$1", $line); } - return $line; + return "\n#line 1 \"reply input\"\n$line"; } sub _eval { -- cgit v1.2.3-54-g00ecf