help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] What is supposed to happen when upToAll: hits the e


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] What is supposed to happen when upToAll: hits the end of stream?
Date: Fri, 21 May 2010 09:16:13 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.4

On 05/21/2010 06:12 AM, Rick Flower wrote:
On Fri, 21 May 2010 05:56:13 +0200, Paolo Bonzini<address@hidden>  wrote:
Any ideas on whether this was proper handling or not?  I was hoping
it would return the entire string which is what I think it should
be doing based on reading the docs..

Looks like a better choice even if the docs said otherwise.

The only small problem is that an incomplete boundary string at the
end would of course be included in the return value.

Does that mean there's something wrong with the current
implementation of upToAll:?

After actually debugging it, the bug is in pipes. The following patch fixes it, though I am committing another one that gets rid of the "atEnd" instance variable completely.

diff --git a/kernel/FileDescr.st b/kernel/FileDescr.st
index 8f1d23f..54c29e2 100644
--- a/kernel/FileDescr.st
+++ b/kernel/FileDescr.st
@@ -740,7 +740,7 @@ do arbitrary processing on the files.'>
        <category: 'initialize-release'>
        self addToBeFinalized.
        access isNil ifTrue: [access := 3].
-       atEnd := false
+       atEnd := nil
     ]

     readStream [

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]