--- loncom/xml/run.pm 2005/11/08 18:59:03 1.53 +++ loncom/xml/run.pm 2006/03/16 15:47:37 1.58 @@ -1,6 +1,6 @@ package Apache::run; # -# $Id: run.pm,v 1.53 2005/11/08 18:59:03 albertel Exp $ +# $Id: run.pm,v 1.58 2006/03/16 15:47:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,6 +50,7 @@ while (!$_LONCAPA_INTERNAL_oldexpression my $__LC__prefix; my $__LC__result; while (1) { + if ($__LC__a =~ m-^&(theta|pi|rho)$-) { last; } { use strict; no strict "vars"; @@ -77,7 +78,7 @@ sub evaluate { my $result = ''; $@=''; $Apache::run::timeout=0; - $main::SIG{'ALRM'} = sub { + local $main::SIG{'ALRM'} = sub { $Apache::run::timeout=1; die("timeout"); }; @@ -115,7 +116,7 @@ sub run { my @result; $@=''; $Apache::run::timeout=0; - $main::SIG{'ALRM'} = sub { + local $main::SIG{'ALRM'} = sub { $Apache::run::timeout=1; die("timeout"); }; @@ -139,8 +140,10 @@ sub run { if ($innererror=~/line (\d+)/) { my $linenumber=$1; my @code=split("\n",$code); - $code[$linenumber-1]=''. - $code[$linenumber-1].''; + if ($linenumber < scalar(@code)) { + $code[$linenumber-1]=''. + $code[$linenumber-1].''; + } $code=join("\n",@code); } &Apache::lonxml::error($errormsg.$code.''); @@ -157,7 +160,8 @@ sub dump { my ($target,$safeeval)=@_; my $dump=''; foreach my $symname (sort keys %{$safeeval->varglob('main::')}) { - if (($symname!~/\027/) && ($symname!~/^\_/) && ($symname!~/\:$/)) { + if (($symname!~ /^(INC|SIG)/) && ($symname!~/\027/) && + ($symname!~/^\_/) && ($symname!~/\:$/)) { my $line; if ($safeeval->reval('defined($'.$symname.')')) { if ($symname =~ /^\w/) {