[gnome-system-log] window: actually insert the converted data into the buffer



commit 575ff413620dd17adb4c52a8ae79f744a694c7a1
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 19 14:29:22 2012 -0400

    window: actually insert the converted data into the buffer
    
    We were converting the data in case it was not UTF-8, but failed to put
    it into the buffer correctly.

 src/logview-window.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/logview-window.c b/src/logview-window.c
index ee45963..e94aee6 100644
--- a/src/logview-window.c
+++ b/src/logview-window.c
@@ -1000,7 +1000,8 @@ read_new_lines_cb (LogviewLog *log,
 
     if (!g_utf8_validate (lines[i], len, NULL)) {
       converted = g_locale_to_utf8 (lines[i], (gssize) len, NULL, &len, NULL);
-      gtk_text_buffer_insert (buffer, &iter, lines[i], len);
+      gtk_text_buffer_insert (buffer, &iter, converted, len);
+      g_free (converted);
     } else {
       gtk_text_buffer_insert (buffer, &iter, lines[i], strlen (lines[i]));
     }



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