--- loncom/lonr 2009/04/17 00:07:00 1.1 +++ loncom/lonr 2009/04/17 00:34:46 1.2 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # Connect to MAXIMA CAS # -# $Id: lonr,v 1.1 2009/04/17 00:07:00 www Exp $ +# $Id: lonr,v 1.2 2009/04/17 00:34:46 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -282,7 +282,7 @@ sub make_new_child { while (my $cmd=<$client>) { &status('Processing command'); print $command &unescape($cmd); - my ($reply,$syntaxerr) = &getroutput($command,1); + my ($reply,$syntaxerr) = &getroutput($command); print $client &escape($reply)."\n"; if ($syntaxerr) { last; @@ -351,6 +351,7 @@ sub getroutput { my $realoutput=''; foreach my $line (split(/\n/,$output)) { $line=~s/\s$//gs; + if ($line=~/^Error\:/) { $syntaxerr=1; next; } if (my ($result)=($line=~/^\[\d+\,*\]\s*(.*)/)) { $realoutput.=$result."\n"; } } if (wantarray) {