EOF needs to be checked again.
[core.git] / inc / classes / main / iterator / io / class_FileIoIterator.php
index 7f30fb514f1577c829b7d57eeb01f53512bf98d2..9ef4801d2a25dc6ab807492ea9c4744b3056afc6 100644 (file)
@@ -150,9 +150,16 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
 
                // Wait until a entry/block separator has been found
                $data = $this->getBackBuffer();
-               while (!$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
 
                /*