Skip to content

Commit

Permalink
2006-04-29 Atsushi Enomoto <atsushi@ximian.com>
Browse files Browse the repository at this point in the history
	* UnexceptionalStreamReader.cs (Read): Fix for #78218, where we
	consumed characters from the input even when the count was not set
	to zero, causing some characters to be missing in some
	circumstances. 

svn path=/branches/mono-1-1-13/mcs/; revision=60077
  • Loading branch information
migueldeicaza committed Apr 29, 2006
1 parent ac73df9 commit ebcbcb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions mcs/class/corlib/System.IO/ChangeLog
@@ -1,3 +1,10 @@
2006-04-29 Atsushi Enomoto <atsushi@ximian.com>

* UnexceptionalStreamReader.cs (Read): Fix for #78218, where we
consumed characters from the input even when the count was not set
to zero, causing some characters to be missing in some
circumstances.

2006-04-21 Zoltan Varga <vargaz@gmail.com>

* FileStream.cs: Add new net 2.0 ctor.
Expand Down
8 changes: 4 additions & 4 deletions mcs/class/corlib/System.IO/UnexceptionalStreamReader.cs
Expand Up @@ -128,16 +128,16 @@ public override int Read ()
throw new ArgumentException ("index + count > dest_buffer.Length");

int chars_read = 0;
int c = Read ();
while ((c != -1) && (count > 0)) {
while (count > 0) {
int c = Read ();
if (c < 0)
break;
chars_read++;
count--;

dest_buffer [index] = (char) c;
if (CheckEOL (dest_buffer [index++]))
return chars_read;

c = Read ();
}
return chars_read;
}
Expand Down

0 comments on commit ebcbcb5

Please sign in to comment.