diff options
author | Miguel de Icaza <miguel@gnome.org> | 2007-01-24 03:45:35 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2007-01-24 03:45:35 +0300 |
commit | ec090a950534e420254a29488952a8fedeab3ceb (patch) | |
tree | 6973447a0ee282bf4a9cc7cbfcfa643580ed7c10 | |
parent | e77a7d6a017826d46673089f56ef7ac2bb824341 (diff) |
2007-01-23 Miguel de Icaza <miguel@novell.com>
* StreamReader.cs (Read): Fix this overload, we were just lucky
that it worked in the past. Must trigger a load from the buffer
if we reached its end.
svn path=/trunk/mcs/; revision=71573
-rw-r--r-- | mcs/class/corlib/System.IO/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/corlib/System.IO/StreamReader.cs | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog index 9b0f387c3db..22d24b61ccc 100644 --- a/mcs/class/corlib/System.IO/ChangeLog +++ b/mcs/class/corlib/System.IO/ChangeLog @@ -1,3 +1,9 @@ +2007-01-23 Miguel de Icaza <miguel@novell.com> + + * StreamReader.cs (Read): Fix this overload, we were just lucky + that it worked in the past. Must trigger a load from the buffer + if we reached its end. + 2007-01-22 Miguel de Icaza <miguel@novell.com> * DirectoryInfo.cs: Throw a better exception (accorind go the diff --git a/mcs/class/corlib/System.IO/StreamReader.cs b/mcs/class/corlib/System.IO/StreamReader.cs index 9102031f2f3..81a50b5e06c 100644 --- a/mcs/class/corlib/System.IO/StreamReader.cs +++ b/mcs/class/corlib/System.IO/StreamReader.cs @@ -346,6 +346,10 @@ namespace System.IO { if (pos >= decoded_count && ReadBuffer () == 0) return -1; + if (pos >= decoded_count){ + if (ReadBuffer () == 0) + return -1; + } return decoded_buffer [pos++]; } |