2003-02-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 11 Feb 2003 05:42:51 +0000 (05:42 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 11 Feb 2003 05:42:51 +0000 (05:42 -0000)
* StringReader.cs:
(ReadLine): fixed the case when the string ends with a '\n'.

svn path=/trunk/mcs/; revision=11473

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/StringReader.cs

index b14c067be1e1085c55268497fa697497bcb3d894..85834058c9ec5c15dd2b92354be2fd73fccfcb43 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * StringReader.cs:
+       (ReadLine): fixed the case when the string ends with a '\n'.
+
 2003-02-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * MemoryStream.cs: create the buffer of the specified capacity.
index 47c4d3f7346eeca5008f248434a94ac081620ace..4f674f676e1fd333146004684dd90a5e56c834a0 100644 (file)
@@ -94,7 +94,7 @@ namespace System.IO {
                         // HOWEVER, the MS implementation returns the rest of the string if no \r and/or \n is found
                         // in the string
 
-                       if (nextChar == source.Length)
+                       if (nextChar >= source.Length)
                                return null;
 
                        int nextCR = source.IndexOf( '\r', nextChar );