ff is a separator too (in #skipSeparators*)
authorClaus Gittinger <cg@exept.de>
Tue, 14 Jan 1997 15:14:39 +0100
changeset 2162 7e1601f633b6
parent 2161 0472a226a714
child 2163 2fcc0e7c11f8
ff is a separator too (in #skipSeparators*)
ReadStr.st
ReadStream.st
--- a/ReadStr.st	Tue Jan 14 12:49:01 1997 +0100
+++ b/ReadStr.st	Tue Jan 14 15:14:39 1997 +0100
@@ -17,7 +17,7 @@
 	category:'Streams'
 !
 
-!ReadStream  class methodsFor:'documentation'!
+!ReadStream class methodsFor:'documentation'!
 
 copyright
 "
@@ -447,6 +447,7 @@
                  && (ch != '\t')
                  && (ch != '\r')
                  && (ch != '\n')
+                 && (ch != '\f')
                  && (ch != 0x0B))) {
                 __INST(position) = __MKSMALLINT(pos-1);
                 RETURN ( __MKCHARACTER(ch) );
@@ -481,31 +482,37 @@
     l = __INST(readLimit);
 
     if (__isString(coll) && __bothSmallInteger(p, l)) {
-	REGISTER unsigned char *chars;
-	REGISTER unsigned ch;
-	REGISTER int pos;
-	int limit;
+        REGISTER unsigned char *chars;
+        REGISTER unsigned ch;
+        REGISTER int pos;
+        int limit;
 
-	pos = __intVal(p);
-	if (pos <= 0) {
-	    RETURN ( nil );
-	}
+        pos = __intVal(p);
+        if (pos <= 0) {
+            RETURN ( nil );
+        }
+
+        limit = __intVal(l);
+        if (limit > (__qSize(coll) - OHDR_SIZE))
+            limit = __qSize(coll) - OHDR_SIZE;
 
-	limit = __intVal(l);
-	if (limit > (__qSize(coll) - OHDR_SIZE))
-	    limit = __qSize(coll) - OHDR_SIZE;
-
-	chars = (unsigned char *)(__stringVal(coll) + pos - 1);
-	while (pos <= limit) {
-	    ch = *chars++;
-	    if ((ch != ' ') && (ch != '\t') && (ch != '\r') && (ch != 0x0B)) {
-		__INST(position) = __MKSMALLINT(pos);
-		RETURN ( __MKCHARACTER(ch) );
-	    }
-	    pos++;
-	}
-	__INST(position) = __MKSMALLINT(pos);
-	RETURN ( nil );
+        chars = (unsigned char *)(__stringVal(coll) + pos - 1);
+        while (pos <= limit) {
+            ch = *chars++;
+            if (((int)ch > 0x20)
+             || (
+                 (ch != ' ') 
+                 && (ch != '\t')
+                 && (ch != '\f')
+                 && (ch != '\b')
+                 && (ch != 0x0B))) {
+                __INST(position) = __MKSMALLINT(pos);
+                RETURN ( __MKCHARACTER(ch) );
+            }
+            pos++;
+        }
+        __INST(position) = __MKSMALLINT(pos);
+        RETURN ( nil );
     }
 %}
 .
@@ -569,8 +576,8 @@
     self shouldNotImplement
 ! !
 
-!ReadStream  class methodsFor:'documentation'!
+!ReadStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ReadStr.st,v 1.32 1996-10-02 11:33:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ReadStr.st,v 1.33 1997-01-14 14:14:39 cg Exp $'
 ! !
--- a/ReadStream.st	Tue Jan 14 12:49:01 1997 +0100
+++ b/ReadStream.st	Tue Jan 14 15:14:39 1997 +0100
@@ -17,7 +17,7 @@
 	category:'Streams'
 !
 
-!ReadStream  class methodsFor:'documentation'!
+!ReadStream class methodsFor:'documentation'!
 
 copyright
 "
@@ -447,6 +447,7 @@
                  && (ch != '\t')
                  && (ch != '\r')
                  && (ch != '\n')
+                 && (ch != '\f')
                  && (ch != 0x0B))) {
                 __INST(position) = __MKSMALLINT(pos-1);
                 RETURN ( __MKCHARACTER(ch) );
@@ -481,31 +482,37 @@
     l = __INST(readLimit);
 
     if (__isString(coll) && __bothSmallInteger(p, l)) {
-	REGISTER unsigned char *chars;
-	REGISTER unsigned ch;
-	REGISTER int pos;
-	int limit;
+        REGISTER unsigned char *chars;
+        REGISTER unsigned ch;
+        REGISTER int pos;
+        int limit;
 
-	pos = __intVal(p);
-	if (pos <= 0) {
-	    RETURN ( nil );
-	}
+        pos = __intVal(p);
+        if (pos <= 0) {
+            RETURN ( nil );
+        }
+
+        limit = __intVal(l);
+        if (limit > (__qSize(coll) - OHDR_SIZE))
+            limit = __qSize(coll) - OHDR_SIZE;
 
-	limit = __intVal(l);
-	if (limit > (__qSize(coll) - OHDR_SIZE))
-	    limit = __qSize(coll) - OHDR_SIZE;
-
-	chars = (unsigned char *)(__stringVal(coll) + pos - 1);
-	while (pos <= limit) {
-	    ch = *chars++;
-	    if ((ch != ' ') && (ch != '\t') && (ch != '\r') && (ch != 0x0B)) {
-		__INST(position) = __MKSMALLINT(pos);
-		RETURN ( __MKCHARACTER(ch) );
-	    }
-	    pos++;
-	}
-	__INST(position) = __MKSMALLINT(pos);
-	RETURN ( nil );
+        chars = (unsigned char *)(__stringVal(coll) + pos - 1);
+        while (pos <= limit) {
+            ch = *chars++;
+            if (((int)ch > 0x20)
+             || (
+                 (ch != ' ') 
+                 && (ch != '\t')
+                 && (ch != '\f')
+                 && (ch != '\b')
+                 && (ch != 0x0B))) {
+                __INST(position) = __MKSMALLINT(pos);
+                RETURN ( __MKCHARACTER(ch) );
+            }
+            pos++;
+        }
+        __INST(position) = __MKSMALLINT(pos);
+        RETURN ( nil );
     }
 %}
 .
@@ -569,8 +576,8 @@
     self shouldNotImplement
 ! !
 
-!ReadStream  class methodsFor:'documentation'!
+!ReadStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.32 1996-10-02 11:33:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.33 1997-01-14 14:14:39 cg Exp $'
 ! !