[gnome-control-center] region: Fix infinite loop when selecting Xkb options
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Fix infinite loop when selecting Xkb options
- Date: Wed, 19 Jan 2011 15:13:41 +0000 (UTC)
commit 978ae121f2a663710b3c7b53d6d24fefbbd38f06
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 19 14:51:34 2011 +0000
region: Fix infinite loop when selecting Xkb options
Spotted by Arun Raghavan <arun raghavan collabora co uk>
https://bugzilla.gnome.org/show_bug.cgi?id=639951
panels/region/gnome-region-panel-xkbot.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-xkbot.c b/panels/region/gnome-region-panel-xkbot.c
index 333aa18..f43be42 100644
--- a/panels/region/gnome-region-panel-xkbot.c
+++ b/panels/region/gnome-region-panel-xkbot.c
@@ -111,14 +111,16 @@ static void
xkb_options_select (gchar * optionname)
{
gboolean already_selected = FALSE;
- gchar **options_list = xkb_options_get_selected_list ();
- if (options_list != NULL) {
- gchar **option = options_list;
- while (*option != NULL)
- if (!strcmp (*option, optionname)) {
- already_selected = TRUE;
- break;
- }
+ gchar **options_list;
+ guint i;
+
+ options_list = xkb_options_get_selected_list ();
+ for (i = 0; options_list != NULL && options_list[i] != NULL; i++) {
+ gchar *option = options_list[i];
+ if (!strcmp (option, optionname)) {
+ already_selected = TRUE;
+ break;
+ }
}
if (!already_selected) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]