From e10454ded867c286a21c949df9eab55f510b368d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Mon, 15 Nov 2010 18:22:52 +0000 Subject: [PATCH] - Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the stream). --- ext/standard/tests/file/bug52820.phpt | 69 +++++++++++++++++++++++++++ main/streams/streams.c | 5 ++ 2 files changed, 74 insertions(+) create mode 100644 ext/standard/tests/file/bug52820.phpt diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt new file mode 100644 index 0000000000..a631bef4b3 --- /dev/null +++ b/ext/standard/tests/file/bug52820.phpt @@ -0,0 +1,69 @@ +--TEST-- +Bug #52820 (writes to fopencookie FILE* not commited when seeking the stream) +--SKIPIF-- +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) { -- 2.40.0