From: Chris S. <san...@us...> - 2005-07-14 11:37:16
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13325/scripts Modified Files: stackUnix.php Log Message: Index: stackUnix.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUnix.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** stackUnix.php 14 Jul 2005 08:46:53 -0000 1.14 --- stackUnix.php 14 Jul 2005 11:37:08 -0000 1.15 *************** *** 30,34 **** 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), ! 2 => array('file', $stack_logfiles."/tex_errors.txt", 'a')); $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); --- 30,34 ---- 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), ! 2 => array('pipe', 'w')); $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); *************** *** 48,55 **** fclose($pipes[1]); } ! $ret = trim($ret); ! return $ret; } --- 48,68 ---- fclose($pipes[1]); + + // Error trapping + $err = ''; + while (!feof($pipes[2])) { + $err .= fgets($pipes[2], 1024); + } + fclose($pipes[2]); + } ! if ($errstr = strstr($err,'Error')) { ! $ret = "<p>TtH error: <font color='orange'><tt>$errstr</tt></font></p>"; ! } else { ! $ret = trim($ret); ! } ! ! return $ret; } *************** *** 131,141 **** $ret .=' The CAS timed out. ] ] ] ]'; } ! ! // Error trapping ! $err = ''; ! while (!feof($pipes[2])) { ! $err .= fgets($pipes[2], 1024); ! } ! fclose($pipes[2]); } else { --- 144,148 ---- $ret .=' The CAS timed out. ] ] ] ]'; } ! } else { *************** *** 145,155 **** } ! if ($errstr = strstr($err,'Error')) { ! $ret = "<p>TtH error: <font color='orange'><tt>$errstr</tt></font></p>"; ! } else { ! $ret = trim($ret); ! } ! ! return $ret; } --- 152,156 ---- } ! return $ret; } |