Make offset accept negative values

git-svn-id: http://php-reader.googlecode.com/svn/trunk@6 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
svollbehr
2008-03-03 22:00:05 +00:00
parent 1c99955fe1
commit 294194ca50

View File

@@ -144,7 +144,7 @@ class Reader
*/ */
public function setOffset($offset) public function setOffset($offset)
{ {
fseek($this->_fd, $offset); fseek($this->_fd, $offset < 0 ? $this->_size + $offset : $offset);
} }
/** /**