[Pkg-owncloud-commits] [owncloud] 03/134: implement ftell stream wrapper and fix return value from fseek stream wrapper
David Prévot
taffit at moszumanska.debian.org
Fri Apr 18 21:43:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 8b3d99308c3be77e5c042ab7f64de53fa79adf50
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Wed Dec 18 15:40:43 2013 +0100
implement ftell stream wrapper and fix return value from fseek stream wrapper
---
apps/files_encryption/lib/stream.php | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 7a37d22..c3cbdd5 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -164,14 +164,25 @@ class Stream {
}
/**
+ * @brief Returns the current position of the file pointer
+ * @return int position of the file pointer
+ */
+ public function stream_tell() {
+ return ftell($this->handle);
+ }
+
+ /**
* @param $offset
* @param int $whence
+ * @return bool true if fseek was successful, otherwise false
*/
public function stream_seek($offset, $whence = SEEK_SET) {
$this->flush();
- fseek($this->handle, $offset, $whence);
+ // this wrapper needs to return "true" for success.
+ // the fseek call itself returns 0 on succeess
+ return !fseek($this->handle, $offset, $whence);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list