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 */
didread += toread;
}
- if (size == 0 || stream->eof) {
+ /* ignore eof here; the underlying state might have changed */
+ if (size == 0) {
break;
}
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)