]> granicus.if.org Git - php/commitdiff
fix ftell/fseek in stdio streams
authorWez Furlong <wez@php.net>
Sat, 16 Mar 2002 18:52:03 +0000 (18:52 +0000)
committerWez Furlong <wez@php.net>
Sat, 16 Mar 2002 18:52:03 +0000 (18:52 +0000)
main/streams.c

index ed465685faea49bac02f2dbbc0c60569ab93764e..4dbea1c2c9bf82ee3412393a1c08236334c1ae59 100755 (executable)
@@ -536,6 +536,9 @@ static int php_stdiop_seek(php_stream *stream, off_t offset, int whence)
 
        assert(data != NULL);
 
+       if (offset == 0 && whence == SEEK_CUR)
+               return ftell(data->file);
+       
        return fseek(data->file, offset, whence);
 }