CrLfFileStream>>next: bug

Pennell pennell at tiac.net
Mon Sep 21 13:27:13 UTC 1998


If you create a new file in the file browser and then click on it,
CrLfFileStream>>next:
dies because it doesn't deal with n==0.  The superclass returns a String
with size 0.

This is broken in both 2.1 and 2.2Beta.

I can't believe I waited so long to try this.  If you don't use a Mac, then
filing in code
pulled down with you browser or received via e-mail.

Dan - thanks for adding this in 2.2.  Is there any reason not to make this
the default?
If you don't change the default for 2.2, can you add it as a preference?

- david
----------------------
'From Squeak 2.1 of June 30, 1998 on 21 September 1998 at 8:54:47 am'!

!CrLfFileStream methodsFor: 'access' stamp: 'djp 9/21/1998 08:48'!
next: n
 | string |
 string _ super next: n.
 string size == 0 ifTrue: [^string].
 lineEndConvention ifNil: [^ string].
 lineEndConvention == #crlf
  ifTrue: ["Special case for last character"
   (string last = Cr and: [self peek = Lf])
    ifTrue: [self next]].
 ^ self convertStringToCr: string! !





More information about the Squeak-dev mailing list