[Mono-list] [PATCH] BufferedStream.cs

Carlos Guzmán Álvarez carlosga@telefonica.net
Wed, 20 Nov 2002 20:12:45 +0100


This is a multi-part message in MIME format.
--------------090304040303010304020202
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hola:

> Podrías re-enviar tu parche?


Aqui va con la sugerencia de Gonzalo solo un apunte, uso CanSeek 
directamente en ve m_stream.CanSeek pq la propiedad ya se encarga de 
hacerlo, creo q es correcto aunq ahora no lo puedo probar ya q el modem 
solo me va en windows :(



Un saludo
Carlos Guzmán Álvarez
Vigo-España

--------------090304040303010304020202
Content-Type: text/plain;
 name="patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch.txt"

Index: BufferedStream.cs
===================================================================
RCS file: /mono/mcs/class/corlib/System.IO/BufferedStream.cs,v
retrieving revision 1.2
diff -u -r1.2 BufferedStream.cs
--- BufferedStream.cs	8 May 2002 13:21:11 -0000	1.2
+++ BufferedStream.cs	20 Nov 2002 19:05:30 -0000
@@ -65,7 +65,9 @@
 
 		public override void Flush() {
 			if (m_buffer_reading) {
-				m_stream.Position = Position;
+				if(CanSeek){
+					m_stream.Position = Position;
+				}
 			} else {
 				m_stream.Write(m_buffer, 0, m_buffer_pos);
 			}

--------------090304040303010304020202--