DirectoryStream.st
changeset 17302 a8f3099d0b64
parent 17292 1def0bd4e51d
child 18120 e3a375d5f6a8
child 18780 cdf7956a75e1
--- a/DirectoryStream.st	Thu Jan 15 14:08:05 2015 +0100
+++ b/DirectoryStream.st	Thu Jan 15 16:24:41 2015 +0100
@@ -523,21 +523,21 @@
 
     |nextResult resultInfo|
 
-    hitEOF ifTrue:[
-	^ self pastEndRead
+    (hitEOF or:[readAheadEntry isNil]) ifTrue:[
+        ^ self pastEndRead
     ].
 
     nextResult := OperatingSystem nextLinkInfoFrom:self dirPointer:dirPointer.
     nextResult isNil ifTrue:[
-	hitEOF := true.
+        hitEOF := true.
     ].
     readAheadEntry notNil ifTrue:[
-	resultInfo := readAheadEntry.
-	readAheadEntry := nextResult.
-	^ resultInfo
+        resultInfo := readAheadEntry.
+        readAheadEntry := nextResult.
+        ^ resultInfo
     ].
     nextResult isNil ifTrue:[
-	^ self pastEndRead
+        ^ self pastEndRead
     ].
     ^ nextResult
 ! !
@@ -729,7 +729,7 @@
 atEnd
     "return true, if position is at end"
 
-    ^ hitEOF "/ readAheadEntry == nil
+    ^ readAheadEntry == nil
 !
 
 isEmpty
@@ -762,9 +762,10 @@
 !DirectoryStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.86 2015-01-12 15:54:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.87 2015-01-15 15:24:41 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.86 2015-01-12 15:54:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.87 2015-01-15 15:24:41 cg Exp $'
 ! !
+