- If (SEEK_CUR,0) means an illegal seek we return -1 to denote the error

This commit is contained in:
Marcus Boerger 2006-02-28 18:00:03 +00:00
parent d31641e2d8
commit 56ec57c614

View File

@ -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) {