2009-04-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 24 Apr 2009 16:46:19 +0000 (16:46 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 24 Apr 2009 16:46:19 +0000 (16:46 -0000)
* StreamReader.cs: if Peek() needs to block, do it.
Fixes bug #496905.

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

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

index 9f21d26463e433812fdc58433cc0853e71e51836..12683626844153082f1f112d066aa221e5e4c3b2 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * StreamReader.cs: if Peek() needs to block, do it.
+       Fixes bug #496905.
+
 2009-03-22  Marek Habersack  <mhabersack@novell.com>
 
        * FileStream.cs: implemented the SafeFileHandle property.
index 8e7f0e71e5b19f3ae633cacd9d3e173b491a9bec..5e0d28f6c66c7b248b2fc4bba1c28398565b6b52 100644 (file)
@@ -362,7 +362,7 @@ namespace System.IO {
                {
                        if (base_stream == null)
                                throw new ObjectDisposedException ("StreamReader", "Cannot read from a closed StreamReader");
-                       if (pos >= decoded_count && (mayBlock || ReadBuffer () == 0))
+                       if (pos >= decoded_count && ReadBuffer () == 0)
                                return -1;
 
                        return decoded_buffer [pos];