--- a/ExternalStream.st Sun Jul 02 14:53:36 2000 +0200
+++ b/ExternalStream.st Mon Jul 03 10:55:50 2000 +0200
@@ -1967,8 +1967,8 @@
"return the kind of object to be returned by sub-collection builders
(such as upTo)"
- binary ifTrue:[
- ^ ByteArray
+ binary == true ifTrue:[
+ ^ ByteArray
].
^ String
!
@@ -4624,52 +4624,48 @@
__INST(lastErrorNumber) = nil;
if (((fp = __INST(filePointer)) != nil)
- && (__INST(mode) != @symbol(writeonly))
+ && (__INST(mode) != @symbol(writeonly))
) {
- if (__INST(binary) == true) {
- if (__isSmallInteger(anObject)) {
- peekValue = __intVal(anObject) & 0xFF;
- } else {
- goto bad;
- }
- } else {
- if (__isCharacter(anObject)) {
- peekValue = __intVal(_characterVal(anObject)) & 0xFF;
- } else {
- goto bad;
- }
- }
-
- f = __FILEVal(fp);
-
- _buffered = (__INST(buffered) == true);
- if (_buffered) {
- __READING__(f)
- }
- __READBYTE__(ret, f, &c, _buffered);
- if (ret > 0) {
- if (c == peekValue) {
- OBJ pos;
-
- if ((pos = __INST(position)) != nil) {
- __INST(position) = __MKSMALLINT(__intVal(pos) + 1);
- }
- RETURN (true);
- }
- __UNGETC__(c, f, _buffered);
- RETURN (false);
- }
- if (ret < 0) {
- __INST(lastErrorNumber) = __MKSMALLINT(__threadErrno);
- } else /* ret == 0 */
- __INST(hitEOF) = true;
- }
+ if (__INST(binary) == true) {
+ if (__isSmallInteger(anObject)) {
+ peekValue = __intVal(anObject) & 0xFF;
+ } else {
+ goto bad;
+ }
+ } else {
+ if (__isCharacter(anObject)) {
+ peekValue = __intVal(_characterVal(anObject)) & 0xFF;
+ } else {
+ goto bad;
+ }
+ }
+
+ f = __FILEVal(fp);
+
+ _buffered = (__INST(buffered) == true);
+ if (_buffered) {
+ __READING__(f)
+ }
+ __READBYTE__(ret, f, &c, _buffered);
+ if (ret > 0) {
+ if (c == peekValue) {
+ OBJ pos;
+
+ if ((pos = __INST(position)) != nil) {
+ __INST(position) = __MKSMALLINT(__intVal(pos) + 1);
+ }
+ RETURN (true);
+ }
+ __UNGETC__(c, f, _buffered);
+ RETURN (false);
+ }
+ if (ret < 0) {
+ __INST(lastErrorNumber) = __MKSMALLINT(__threadErrno);
+ } else /* ret == 0 */
+ __INST(hitEOF) = true;
+ }
bad: ;
%}.
- mode == #writeonly ifTrue:[^ self errorWriteOnly].
- hitEOF ifTrue:[self pastEnd. ^ false].
- lastErrorNumber notNil ifTrue:[^ self readError].
- filePointer isNil ifTrue:[^ self errorNotOpen].
^ super peekFor:anObject
!
@@ -5620,6 +5616,6 @@
!ExternalStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.216 2000-06-28 08:29:29 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.217 2000-07-03 08:55:50 cg Exp $'
! !
ExternalStream initialize!