sas Thu Jan 30 16:10:44 2003 EDT
Modified files: (Branch: PHP_4)
/php4/main streams.c
Log:
Partial MFH: Fix sticky eof issue, and avoid calling system stat macro
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.25 php4/main/streams.c:1.125.2.25.2.1
--- php4/main/streams.c:1.125.2.25 Wed Jan 1 04:55:38 2003
+++ php4/main/streams.c Thu Jan 30 16:10:43 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.125.2.25 2003/01/01 09:55:38 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.25.2.1 2003/01/30 21:10:43 sas Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -516,8 +516,7 @@
if (stream->writepos - stream->readpos < (off_t)size) {
size_t justread = 0;
- if (stream->eof)
- return;
+ /* ignore eof here; the underlying state might have changed */
/* no; so lets fetch more data */
@@ -576,7 +575,8 @@
didread += toread;
}
- if (size == 0 || stream->eof) {
+ /* ignore eof here; the underlying state might have changed */
+ if (size == 0) {
break;
}
@@ -674,7 +674,7 @@
return -1;
}
- return stream->ops->stat(stream, ssb TSRMLS_CC);
+ return (stream->ops->stat)(stream, ssb TSRMLS_CC);
}
PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len
TSRMLS_DC)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php