[gedit] Fix the returning size by the output stream.



commit a63ea5df4f5d62a8351d4205850afe903e4bd116
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Mar 1 17:42:53 2010 +0100

    Fix the returning size by the output stream.
    
    When we were storing the remainder we weren't returning the stored
    size.

 gedit/gedit-document-output-stream.c |    2 +-
 tests/document-output-stream.c       |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-document-output-stream.c b/gedit/gedit-document-output-stream.c
index 22b692a..08691b9 100644
--- a/gedit/gedit-document-output-stream.c
+++ b/gedit/gedit-document-output-stream.c
@@ -345,7 +345,7 @@ gedit_document_output_stream_write (GOutputStream            *stream,
 	if (freetext)
 		g_free (text);
 
-	return len;
+	return count;
 }
 
 static gboolean
diff --git a/tests/document-output-stream.c b/tests/document-output-stream.c
index 85a30d8..3711421 100644
--- a/tests/document-output-stream.c
+++ b/tests/document-output-stream.c
@@ -106,6 +106,13 @@ test_consecutive_tnewline ()
 				GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF);
 }
 
+static void
+test_big_char ()
+{
+	test_consecutive_write ("ã??ã??", "ã??ã??", 2,
+				GEDIT_DOCUMENT_NEWLINE_TYPE_LF);
+}
+
 int main (int   argc,
           char *argv[])
 {
@@ -118,6 +125,7 @@ int main (int   argc,
 
 	g_test_add_func ("/document-output-stream/consecutive", test_consecutive);
 	g_test_add_func ("/document-output-stream/consecutive_tnewline", test_consecutive_tnewline);
+	g_test_add_func ("/document-output-stream/big-char", test_big_char);
 
 	return g_test_run ();
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]