From 05e832d14f29937c3b2de729afa1c4900db63110 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 24 Mar 2013 20:25:58 -0500 Subject: [PATCH] SFTP_Stream: Better EOF detection $result will be false on error and '' if the EOF is reached. --- phpseclib/Net/SFTP/Stream.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SFTP/Stream.php b/phpseclib/Net/SFTP/Stream.php index 4d3f6cf6..c53bddc4 100644 --- a/phpseclib/Net/SFTP/Stream.php +++ b/phpseclib/Net/SFTP/Stream.php @@ -256,7 +256,7 @@ class Net_SFTP_Stream { //} $result = $this->sftp->get($this->path, false, $this->pos, $count); - if ($result === false) { + if (empty($result)) { $this->eof = true; return false; } @@ -659,4 +659,4 @@ class Net_SFTP_Stream { } } -stream_wrapper_register('sftp', 'Net_SFTP_Stream'); \ No newline at end of file +stream_wrapper_register('sftp', 'Net_SFTP_Stream');