--- loncom/xml/run.pm 2005/11/15 20:50:26 1.54 +++ loncom/xml/run.pm 2006/03/16 15:47:37 1.58 @@ -1,6 +1,6 @@ package Apache::run; # -# $Id: run.pm,v 1.54 2005/11/15 20:50:26 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.'');