summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-05-30 06:34:56 -0500
committerJesse Luehrs <doy@tozt.net>2013-05-30 06:34:56 -0500
commit28374a3626f8808995e038993b0a19ab182791c2 (patch)
treeaff7d5c9e93d3d84e2100029db55dd0312e6f116
parent8d856fdbf5d4afaff210b1fbc9b2639ae54f6464 (diff)
downloadreply-28374a3626f8808995e038993b0a19ab182791c2.tar.gz
reply-28374a3626f8808995e038993b0a19ab182791c2.zip
better error reporting
-rw-r--r--lib/Reply.pm5
1 files 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 {