Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.200.mcz==================== Summary ====================
Name: Graphics-nice.200
Author: nice
Time: 23 February 2013, 7:29:22.44 pm
UUID: eeff1466-d298-4c92-ac73-5f968dfc52c3
Ancestors: Graphics-eem.199
Bugfix: reading a XBM image with bits specified in decimal would fail to read a '0' byte.
=============== Diff against Graphics-eem.199 ===============
Item was changed:
----- Method: XBMReadWriter>>parseByteValue (in category 'private') -----
parseByteValue
"skip over separators and return next bytevalue parsed as a C language number:
0ddd is an octal digit.
0xddd is a hex digit.
ddd is decimal."
| source mybase |
stream skipSeparators.
+ source := stream upToAnyOf: CharacterSet separators.
+ source = '0' ifTrue: [^0]..
- source := ReadWriteStream on: String new.
- [stream atEnd or: [ stream peek isSeparator ]]
- whileFalse: [source nextPut: self next asUppercase].
mybase := 10. "Base 10 default"
+ source := source asUppercase readStream.
+ (source peekFor: $0) ifTrue: [
- source reset.
- (source peek = $0) ifTrue: [
mybase := 8. "Octal or Hex, say its Octal unless overridden."
+ (source peekFor: $X) ifTrue: [
- source next.
- (source peek = $X) ifTrue: [
mybase := 16. "Ah. It's Hex."
- source next.
]
].
^ Integer readFrom: source base: mybase!