hyanantha Thu Jul 7 11:43:50 2005 EDT
Modified files:
/ZendEngine2 zend_stream.c
Log:
zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I
believe EOT) for EOF(^D) character. This happens when fread is asked to read
one and only character as is the case with cl interactive mode.
-- Kamesh
http://cvs.php.net/diff.php/ZendEngine2/zend_stream.c?r1=1.11&r2=1.12&ty=u
Index: ZendEngine2/zend_stream.c
diff -u ZendEngine2/zend_stream.c:1.11 ZendEngine2/zend_stream.c:1.12
--- ZendEngine2/zend_stream.c:1.11 Sat Jun 4 12:16:19 2005
+++ ZendEngine2/zend_stream.c Thu Jul 7 11:43:50 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_stream.c,v 1.11 2005/06/04 16:16:19 zeev Exp $ */
+/* $Id: zend_stream.c,v 1.12 2005/07/07 15:43:50 hyanantha Exp $ */
#include "zend.h"
@@ -102,7 +102,16 @@
int c = '*';
size_t n;
+#ifdef NETWARE
+ /*
+ c != 4 check is there as fread of a character in
NetWare LibC gives 4 upon ^D character.
+ Ascii value 4 is actually EOT character which is not
defined anywhere in the LibC
+ or else we can use instead of hardcoded 4.
+ */
+ for ( n = 0; n < len && (c = zend_stream_getc( file_handle
TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n )
+#else
for ( n = 0; n < len && (c = zend_stream_getc( file_handle
TSRMLS_CC)) != EOF && c != '\n'; ++n )
+#endif
buf[n] = (char) c;
if ( c == '\n' )
buf[n++] = (char) c;
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|