[LON-CAPA-cvs] cvs: loncom /xml run.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 20 Feb 2006 23:52:21 -0000
albertel Mon Feb 20 18:52:21 2006 EDT
Modified files:
/loncom/xml run.pm
Log:
- don't try to highlight non existant lines BUG#4671
Index: loncom/xml/run.pm
diff -u loncom/xml/run.pm:1.56 loncom/xml/run.pm:1.57
--- loncom/xml/run.pm:1.56 Wed Jan 11 03:56:13 2006
+++ loncom/xml/run.pm Mon Feb 20 18:52:20 2006
@@ -1,6 +1,6 @@
package Apache::run;
#
-# $Id: run.pm,v 1.56 2006/01/11 08:56:13 albertel Exp $
+# $Id: run.pm,v 1.57 2006/02/20 23:52:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -140,8 +140,10 @@
if ($innererror=~/line (\d+)/) {
my $linenumber=$1;
my @code=split("\n",$code);
- $code[$linenumber-1]='<b><font color="red">'.
- $code[$linenumber-1].'</font></b>';
+ if ($linenumber < scalar(@code)) {
+ $code[$linenumber-1]='<b><font color="red">'.
+ $code[$linenumber-1].'</font></b>';
+ }
$code=join("\n",@code);
}
&Apache::lonxml::error($errormsg.$code.'</pre>');