Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in StdioFileStream

39 views
Skip to first unread message

Graham Dicker

unread,
Jan 8, 2013, 3:52:56 AM1/8/13
to
When nextLine reads a line that is exactly 128 bytes long including a
terminating line feed, it goes haywire and reads two lines instead. I fixed
it by changing this bit:

answer := answer , part.
part size = 128]
whileTrue.
len := answer size.
"Strip off the line terminator, allowing for binary or text mode"
last := answer at: len.

into this:

answer := answer , part.
part size = 128 and: [ (answer at: 128) ~= Character lf ] ]
whileTrue.
len := answer size.
"Strip off the line terminator, allowing for binary or text mode"
last := answer at: len.

Graham Dicker

0 new messages