Permalink
Browse files

fix --callback breakage with actual code

The regex to detect simple function calls in 4a7d9bc was
totally wrong, and it ended up thinking everything was a
function call. This broke actual code like:

  camptail --callback='print $message->id, "\n"'

as it got the "(@_)" appended.
  • Loading branch information...
peff committed Mar 31, 2011
1 parent 4a7d9bc commit 6255e8c76e66612b8a0ecd02a0dff772179f9596
Showing with 1 addition and 1 deletion.
  1. +1 −1 camptail.pl
View
@@ -115,7 +115,7 @@ sub read_rcfile {
sub setup_callback {
my (undef, $code) = @_;
if ($code =~ /[A-za-z0-9_]/) {
if ($code =~ /^[A-za-z0-9_]+$/) {
$code .= '(@_)';
}
$callback = eval <<EOF;

0 comments on commit 6255e8c

Please sign in to comment.