diff options
Diffstat (limited to 'Zend/zend_stream.c')
-rw-r--r-- | Zend/zend_stream.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 28af35d76..1f358e033 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_stream.c,v 1.8.2.1 2005/03/13 17:48:12 stas Exp $ */ +/* $Id: zend_stream.c,v 1.8.2.2 2005/07/07 15:39:35 hyanantha Exp $ */ #include "zend.h" @@ -94,7 +94,16 @@ ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_ if (file_handle->handle.stream.interactive) { int c = '*', 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; |