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



commit 85ed78de6d1f144769bf9240e83ca6ca91197980
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 dab87de..e4bd4d3 100644
--- a/src/boards/advanced_colors.c
+++ b/src/boards/advanced_colors.c
@@ -480,7 +480,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]