[chatter] r11818 - trunk/gwydion/common/io/streams

agent at mccarthy.opendylan.org agent at mccarthy.opendylan.org
Mon May 26 22:04:15 CEST 2008


Author: agent
Date: Mon May 26 22:04:14 2008
New Revision: 11818

Modified:
   trunk/gwydion/common/io/streams/convenience.dylan
Log:
Job: minor
Prevented EOS errors in \r\n checks in read-line etc.


Modified: trunk/gwydion/common/io/streams/convenience.dylan
==============================================================================
--- trunk/gwydion/common/io/streams/convenience.dylan	(original)
+++ trunk/gwydion/common/io/streams/convenience.dylan	Mon May 26 22:04:14 2008
@@ -143,7 +143,7 @@
       elseif (next-elt == '\r')
         matched? := #t;
         // If '\r' is followed by '\n', eat the '\n'
-        if (peek(stream) == '\n')
+        if (peek(stream, on-end-of-stream: #f) == '\n')
           read-element(stream)
         end
       else
@@ -186,7 +186,7 @@
       elseif (next-elt == '\r')
         matched? := #t;
         // If '\r' is followed by '\n', eat the '\n'
-        if (peek(stream) == '\n')
+        if (peek(stream, on-end-of-stream: #f) == '\n')
           read-element(stream)
         end
       else
@@ -242,7 +242,7 @@
     let character = read-element(stream);
     select (character)
       '\r' =>
-	if (peek(stream) == '\n')
+	if (peek(stream, on-end-of-stream: #f) == '\n')
 	  read-element(stream)
 	end;
 	'\n';
@@ -282,7 +282,7 @@
       let character :: <character>
 	= select (character)
 	    '\r' =>
-	      if (peek(stream) == '\n')
+	      if (peek(stream, on-end-of-stream: #f) == '\n')
 		read-element(stream)
 	      end;
 	      '\n';


More information about the chatter mailing list