0000-01-23 21:54:16 UTC
==================== Summary ====================
Time: 21 January 2018, 11:03:22.374228 am
MutliByteFileStream>>upToPosition: fix provided by Bob Arning.
See squeak-dev discussion thread "MultiByteFileStream upToAll: strange bug" for background and diagnosis. The problem was introduced in Multilingual-tonyg.218 and merged to trunk in Multilingual-pre.230
Condensed email from Bob:
From: Bob Arning
Date: Sun, 21 Jan 2018 07:01:37 -0500
Subject: Re: [squeak-dev] MultiByteFileStream upToAll: strange bug
The culprit is MultiByteFileStream>>upToPosition: which was referencing the instVar <position> directly. Changing that to "self position" allows it to stop at the right place.
=============== Diff against Multilingual-pre.232 ===============
Item was changed:
----- Method: MultiByteFileStream>>upToPosition: (in category 'accessing') -----
"Answer a subcollection containing items starting from the current position and ending including the given position. Usefully different to #next: in that positions measure *bytes* from the file, where #next: wants to measure *characters*."
^self collectionSpecies new: 1000 streamContents: [ :stream |
| ch |
+ [ (ch := self next) == nil or: [ self position > anInteger ] ]
- [ (ch := self next) == nil or: [ position > anInteger ] ]
whileFalse: [ stream nextP