]> granicus.if.org Git - php/commitdiff
- If (SEEK_CUR,0) means an illegal seek we return -1 to denote the error
authorMarcus Boerger <helly@php.net>
Tue, 28 Feb 2006 18:00:03 +0000 (18:00 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 28 Feb 2006 18:00:03 +0000 (18:00 +0000)
main/streams/streams.c

index 45df9f0c18917d5ab7cd797be775389f3deb6827..0124fc37155b2dea9008af34379bfa94dbc40f02 100755 (executable)
@@ -1638,7 +1638,7 @@ PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_
                        case SEEK_CUR:
                                if (offset == 0) {
                                        /* nothing to do */
-                                       return 0;
+                                       return stream->position >= 0 ? 0 : -1;
                                }
 
                                if (offset > 0 && offset <= stream->readbuf_avail) {