wez             Wed May 12 06:46:30 2004 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/main       streams.c 
  Log:
  Avoid Bug #28363 by not seeking if we don't have a read buffer
  
  
http://cvs.php.net/diff.php/php-src/main/streams.c?r1=1.125.2.88&r2=1.125.2.89&ty=u
Index: php-src/main/streams.c
diff -u php-src/main/streams.c:1.125.2.88 php-src/main/streams.c:1.125.2.89
--- php-src/main/streams.c:1.125.2.88   Tue Mar 30 06:04:32 2004
+++ php-src/main/streams.c      Wed May 12 06:46:30 2004
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.125.2.88 2004/03/30 11:04:32 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.89 2004/05/12 10:46:30 wez Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -896,7 +896,7 @@
        /* if we have a seekable stream we need to ensure that data is written at the
         * current stream->position. This means invalidating the read buffer and then
         * performing a low-level seek */
-       if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) {
+       if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && 
stream->writepos > stream->readpos) {
                stream->readpos = stream->writepos = 0;
 
                stream->ops->seek(stream, stream->position, SEEK_SET, 
&stream->position TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to