diff options
author | Sergey V. Udaltsov <svu@gnome.org> | 2010-10-12 10:54:04 +0100 |
---|---|---|
committer | Sergey V. Udaltsov <svu@gnome.org> | 2010-10-12 10:54:04 +0100 |
commit | dd12792ee893440aa0bc31f3dc8eb2e8996715f5 (patch) | |
tree | dcc12bfeb728201514c48336259221d48a1067e9 /libgnomekbd/gkbd-keyboard-config.c | |
parent | 825727e40ede79bf3c39ae5b637fcecc4c7da5df (diff) | |
download | libgnomekbd-dd12792ee893440aa0bc31f3dc8eb2e8996715f5.tar.gz |
Fixed strv comparison function
The initial implementation was just bad
Diffstat (limited to 'libgnomekbd/gkbd-keyboard-config.c')
-rw-r--r-- | libgnomekbd/gkbd-keyboard-config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgnomekbd/gkbd-keyboard-config.c b/libgnomekbd/gkbd-keyboard-config.c index 5c48be9..6ab4885 100644 --- a/libgnomekbd/gkbd-keyboard-config.c +++ b/libgnomekbd/gkbd-keyboard-config.c @@ -56,7 +56,12 @@ g_strv_equal (gchar ** l1, gchar ** l2) { if (l1 == l2) return TRUE; - while (l1 != NULL && l2 != NULL) { + if (l1 == NULL) + return g_strv_length (l2) == 0; + if (l2 == NULL) + return g_strv_length (l1) == 0; + + while ((*l1 != NULL) && (*l2 != NULL)) { if (*l1 != *l2) { if (*l1 && *l2) { if (g_ascii_strcasecmp (*l1, *l2)) @@ -68,7 +73,7 @@ g_strv_equal (gchar ** l1, gchar ** l2) l1++; l2++; } - return (*l1 && *l2); + return (*l1 == NULL) && (*l2 == NULL); } gboolean |