diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-11-15 18:22:52 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-11-15 18:22:52 +0000 |
commit | 1045aa2a7c8497ff9f74a1078f44e675c558094a (patch) | |
tree | 94e156800f39e6fc2473db05da858f9d4b553648 /main/streams/streams.c | |
parent | d91c4be0d6ac5c52f6a09254103b154d38852ed2 (diff) | |
download | php-git-1045aa2a7c8497ff9f74a1078f44e675c558094a.tar.gz |
- Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the
stream).
Diffstat (limited to 'main/streams/streams.c')
-rwxr-xr-x | main/streams/streams.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index 023977d39e..e08c5e122c 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1093,6 +1093,11 @@ PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC) PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC) { + if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { + /* flush to commit data written to the fopencookie FILE* */ + fflush(stream->stdiocast); + } + /* handle the case where we are in the buffer */ if ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) == 0) { switch(whence) { |