diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 896bdb28e..b069900eb 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -34,7 +34,7 @@ sub _in_eval my $in = -$IN_EVAL; for (my $stack = 1; my $sub = (caller($stack))[3]; $stack++) { - $in--, last if $sub =~ /^Bugzilla::HTTPServerSimple/; + last if $sub =~ /^Bugzilla::HTTPServerSimple/; last if $sub =~ /^ModPerl/; if ($sub =~ /^\(eval\)/) { diff --git a/HTTPServerSimple.pl b/HTTPServerSimple.pl index e6d525b2d..7645fe328 100755 --- a/HTTPServerSimple.pl +++ b/HTTPServerSimple.pl @@ -120,6 +120,7 @@ sub new { for (glob $script) { + ($_) = /^(.*)$/so; eval { $self->load_script($_); @@ -252,6 +253,7 @@ sub run_script my ($script) = @_; $self->load_script($script); my $start = [gettimeofday]; + $Bugzilla::Error::IN_EVAL++; $in_eval = 1; eval { &{$subs{$script}}(); }; $self->check_errors($script); @@ -289,6 +291,7 @@ sub check_errors print STDERR "Error in _cleanup():\n$@"; } $in_eval = 0; + $Bugzilla::Error::IN_EVAL--; if ($err) { $self->internal_error($err);