[libgnomekbd] gkbd_keyboard_config_options_equals: fix comparison of options



commit aef59815d15713b9e6d33ef066ba66206abc01e2
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Apr 4 20:09:31 2012 -0400

    gkbd_keyboard_config_options_equals: fix comparison of options
    
    Since gkbd_keyboard_config_split_items uses static storage, if
    we want to call it twice and compare the results we have to
    make a copy.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673539

 libgnomekbd/gkbd-keyboard-config.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libgnomekbd/gkbd-keyboard-config.c b/libgnomekbd/gkbd-keyboard-config.c
index 6fbff37..6c00f48 100644
--- a/libgnomekbd/gkbd-keyboard-config.c
+++ b/libgnomekbd/gkbd-keyboard-config.c
@@ -527,6 +527,8 @@ gkbd_keyboard_config_options_equals (GkbdKeyboardConfig * kbd_config1,
 			    (kbd_config1->options[i], &group1, &option1))
 				continue;
 
+			option1 = g_strdup (option1);
+
 			for (j = 0; j < num_options && !are_equal; j++) {
 				if (gkbd_keyboard_config_split_items
 				    (kbd_config2->options[j], &group2,
@@ -536,6 +538,8 @@ gkbd_keyboard_config_options_equals (GkbdKeyboardConfig * kbd_config1,
 				}
 			}
 
+			g_free (option1);
+
 			if (!are_equal)
 				return False;
 		}



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