ExternalStream.st
branchjv
changeset 20398 8cb53f870d39
parent 20360 489fe00f7820
parent 20380 fc52f8c44127
child 20578 39641ba8d6e0
--- a/ExternalStream.st	Mon Sep 19 08:39:59 2016 +0100
+++ b/ExternalStream.st	Mon Sep 19 08:46:27 2016 +0100
@@ -5570,19 +5570,19 @@
     char c;
 
     if (__INST(hitEOF) == true) {
-	RETURN (true);
+        RETURN (true);
     }
     pos = __INST(position);
     lim = __INST(readLimit);
     if (lim != nil) {
-	off_t _pos, _readLimit;
-
-	_pos = __signedLongIntVal(pos);
-	_pos = _pos - __intVal( @global(PositionableStream:ZeroPosition)) + 1;
-	_readLimit = __signedLongIntVal(lim);
-	if (_pos > _readLimit) {
-	    RETURN (true);
-	}
+        off_t _pos, _readLimit;
+
+        _pos = __signedLongIntVal(pos);
+        _pos = _pos - __intVal( @global(PositionableStream:ZeroPosition)) + 1;
+        _readLimit = __signedLongIntVal(lim);
+        if (_pos > _readLimit) {
+            RETURN (true);
+        }
     }
 
     __INST(lastErrorNumber) = nil;
@@ -5592,57 +5592,57 @@
      || (__INST(handleType) == @symbol(socketFilePointer))
      || (__INST(handleType) == @symbol(socketHandle))
      || (__INST(handleType) == @symbol(pipeFilePointer))) {
-	if ((fp = __INST(handle)) != nil) {
-	    int _buffered = (__INST(buffered) == true);
-	    int ret;
-	    FILEPOINTER f = __FILEVal(fp);
-
-	    if (_buffered) {
-		__READING__(f);
-	    } else {
-		if (__INST(readAhead) != nil) {
-		    RETURN (false);
-		}
-	    }
-
-	    /*
-	     * read ahead ...
-	     */
-	    do {
+        if ((fp = __INST(handle)) != nil) {
+            int _buffered = (__INST(buffered) == true);
+            int ret;
+            FILEPOINTER f = __FILEVal(fp);
+
+            if (_buffered) {
+                __READING__(f);
+            } else {
+                if (__INST(readAhead) != nil) {
+                    RETURN (false);
+                }
+            }
+
+            /*
+             * read ahead ...
+             */
+            do {
 #ifdef __win32__
 # if 1
-		__READBYTE__(ret, f, &c, _buffered, __INST(handleType));
+                __READBYTE__(ret, f, &c, _buffered, __INST(handleType));
 
 # else
-		__BEGIN_INTERRUPTABLE__
-		__READBYTE__(ret, f, &c, _buffered, __INST(handleType));
-		__END_INTERRUPTABLE__
+                __BEGIN_INTERRUPTABLE__
+                __READBYTE__(ret, f, &c, _buffered, __INST(handleType));
+                __END_INTERRUPTABLE__
 # endif
 #else /* not __win32__ */
-		__BEGIN_INTERRUPTABLE__
-		__READBYTE__(ret, f, &c, _buffered, __INST(handleType));
-		__END_INTERRUPTABLE__
+                __BEGIN_INTERRUPTABLE__
+                __READBYTE__(ret, f, &c, _buffered, __INST(handleType));
+                __END_INTERRUPTABLE__
 #endif
-	    } while ((ret < 0) && (__threadErrno == EINTR));
-
-	    if (ret > 0) {
-		__UNGETC__(c&0xff, f, _buffered);
-		RETURN (false);
-	    }
-	    if (ret == 0) {
-		__INST(hitEOF) = true;
-		RETURN (true);
-	    }
+            } while ((ret < 0) && (__threadErrno == EINTR));
+
+            if (ret > 0) {
+                __UNGETC__(c&0xff, f, _buffered);
+                RETURN (false);
+            }
+            if (ret == 0) {
+                __INST(hitEOF) = true;
+                RETURN (true);
+            }
 #ifdef ECONNRESET
-	    // connection reset by peer is also an EOF
-	    if (__threadErrno == ECONNRESET) {
-		__INST(hitEOF) = true;
-		RETURN (true);
-	    }
+            // connection reset by peer is also an EOF
+            if (__threadErrno == ECONNRESET) {
+                __INST(hitEOF) = true;
+                RETURN (true);
+            }
 #endif
-	    /* ret < 0 */
-	    __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
-	}
+            /* ret < 0 */
+            __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
+        }
     }
 %}.
     lastErrorNumber notNil ifTrue:[^ self readError].
@@ -5652,7 +5652,7 @@
 
     "/ migration support
     ^ self
-	atEndFile:handle
+        atEndFile:handle
 
     "Modified: / 30.10.1998 / 20:16:06 / cg"
 !