From 1045aa2a7c8497ff9f74a1078f44e675c558094a 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). --- NEWS | 2 + ext/standard/tests/file/bug52820.phpt | 98 +++++++++++++++++++++++++++ main/streams/streams.c | 5 ++ 3 files changed, 105 insertions(+) create mode 100644 ext/standard/tests/file/bug52820.phpt diff --git a/NEWS b/NEWS index 389f26c055..e89b7b0a07 100644 --- a/NEWS +++ b/NEWS @@ -122,6 +122,8 @@ mssql_connect). (Felipe) - Fixed bug #52827 (cURL leaks handle and causes assertion error (CURLOPT_STDERR)). (Gustavo) +- Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the + stream). (Gustavo) - Fixed bug #52786 (PHP should reset section to [PHP] after ini sections). (Fedora at famillecollet dot com) - Fixed bug #52784 (Race condition when handling many concurrent signals). diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt new file mode 100644 index 0000000000..70ac9e02b9 --- /dev/null +++ b/ext/standard/tests/file/bug52820.phpt @@ -0,0 +1,98 @@ +--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.50.1