EOF needs to be checked again.
[core.git] / inc / classes / main / iterator / io / class_FileIoIterator.php
index 97a3e3d4abf18195ca582daf231390e52cc6a88e..9ef4801d2a25dc6ab807492ea9c4744b3056afc6 100644 (file)
@@ -150,12 +150,18 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
 
                // Wait until a entry/block separator has been found
                $data = $this->getBackBuffer();
-               while (($this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data)) {
+               while (($this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data))) {
                        // Then read the block
                        $data .= $this->read($length);
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('data()=' . strlen($data));
                } // END - if
 
+               // EOF reached?
+               if ($this->getPointerInstance()->isEndOfFileReached()) {
+                       // Then abort here silently
+                       return;
+               } // END - if
+
                /*
                 * Init back-buffer which is the data that has been found beyond the
                 * separator.