[gcompris/GCOMPRIS_8_3] Fixed a major bug resulting in garbled string in the advanced color



commit 8adcad2b0ad7de44ab92c5b0b2ddd4388402ddcb
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Fri Aug 28 22:44:45 2009 +0200

    Fixed a major bug resulting in garbled string in the advanced color
    activity. In this activity the color to search was garbled in American
    english and in case there is no translations available for the running
    locale.

 src/boards/advanced_colors.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/boards/advanced_colors.c b/src/boards/advanced_colors.c
index 2f94ef6..2762d97 100644
--- a/src/boards/advanced_colors.c
+++ b/src/boards/advanced_colors.c
@@ -481,7 +481,10 @@ static void add_xml_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child)
 	      if(text)
 	      {
 	      	colors[i] = gettext((char *)text);
-	        g_free(text);
+
+		// We got a translation, free the original value
+		if ( text != colors[i] )
+		    g_free(text);
 	      }
 	      text = NULL;
 	      g_free(sColor);



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