Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit e9cb03b

Browse files
committed
When a string is empty, readAll() returns ''.
1 parent 878a069 commit e9cb03b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Read.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ public function readAll ( ) {
192192
$this->seek(0, \Hoa\Stream\IStream\Pointable::SEEK_END);
193193
$end = $this->tell();
194194

195+
if(0 === $end)
196+
return '';
197+
195198
$this->seek(0, \Hoa\Stream\IStream\Pointable::SEEK_SET);
196199
$handle = $this->read($end);
197200

ReadWrite.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ public function readAll ( ) {
200200
$this->seek(0, \Hoa\Stream\IStream\Pointable::SEEK_END);
201201
$end = $this->tell();
202202

203+
if(0 === $end)
204+
return '';
205+
203206
$this->seek(0, \Hoa\Stream\IStream\Pointable::SEEK_SET);
204207
$handle = $this->read($end);
205208

0 commit comments

Comments
 (0)