]> granicus.if.org Git - php/commitdiff
gztell() is not necessary, the return value of gzseek() represents the
authorIlia Alshanetsky <iliaa@php.net>
Thu, 24 Jul 2003 00:03:42 +0000 (00:03 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 24 Jul 2003 00:03:42 +0000 (00:03 +0000)
new position. With zlib 1.1.4 gztell() alse returns 0 when working
on non-zlib files (test ext/zlib/tests/gzreadgzwriteplain.phpt).

ext/zlib/zlib_fopen_wrapper.c

index e899c378f8a16cfdd30254b1d2e885eaffe6b522..32dc3c1cc8034e8b7749ef7100480e27b127acfa 100644 (file)
@@ -56,14 +56,12 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count
 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)