iliaa Wed Jul 23 20:03:42 2003 EDT
Modified files:
/php-src/ext/zlib zlib_fopen_wrapper.c
Log:
gztell() is not necessary, the return value of gzseek() represents the
new position. With zlib 1.1.4 gztell() alse returns 0 when working
on non-zlib files (test ext/zlib/tests/gzreadgzwriteplain.phpt).
Index: php-src/ext/zlib/zlib_fopen_wrapper.c
diff -u php-src/ext/zlib/zlib_fopen_wrapper.c:1.40
php-src/ext/zlib/zlib_fopen_wrapper.c:1.41
--- php-src/ext/zlib/zlib_fopen_wrapper.c:1.40 Tue Jun 10 16:03:41 2003
+++ php-src/ext/zlib/zlib_fopen_wrapper.c Wed Jul 23 20:03:42 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_fopen_wrapper.c,v 1.40 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.41 2003/07/24 00:03:42 iliaa Exp $ */
#define _GNU_SOURCE
@@ -56,14 +56,12 @@
static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t
*newoffs TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)
stream->abstract;
- int ret;
-
+
assert(self != NULL);
-
- ret = gzseek(self->gz_file, offset, whence);
- *newoffs = gztell(self->gz_file);
-
- return (ret < 0) ? -1 : 0;
+
+ *newoffs = gzseek(self->gz_file, offset, whence);
+
+ return (*newoffs < 0) ? -1 : 0;
}
static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php