]> git.pld-linux.org Git - packages/gnome-control-center.git/blame - territory_code.patch
- updated to 46.1
[packages/gnome-control-center.git] / territory_code.patch
CommitLineData
7820027c
AF
1commit cbda9c4c6bbbeff84895f9fefb61cdc90129c68b
2Author: Artur Frysiak <wiget@pld-linux.org>
3Date: Sat Oct 15 22:09:26 2011 +0200
4
5 Fix segfault on locale without territory.
6
7 Some locale (eg. Esperanto) don't have territory. Check
8 locale->territory_code before using it.
9
10diff --git a/panels/common/gdm-languages.c b/panels/common/gdm-languages.c
11index 2dfc436..392e693 100644
12--- a/panels/common/gdm-languages.c
13+++ b/panels/common/gdm-languages.c
14@@ -635,9 +635,11 @@ count_languages_and_territories (void)
15 count++;
16 g_hash_table_insert (gdm_language_count_map, g_strdup (locale->language_code), GINT_TO_POINTER (count));
17
18- count = GPOINTER_TO_INT (g_hash_table_lookup (gdm_territory_count_map, locale->territory_code));
19- count++;
20- g_hash_table_insert (gdm_territory_count_map, g_strdup (locale->territory_code), GINT_TO_POINTER (count));
21+ if (locale->territory_code) {
22+ count = GPOINTER_TO_INT (g_hash_table_lookup (gdm_territory_count_map, locale->territory_code));
23+ count++;
24+ g_hash_table_insert (gdm_territory_count_map, g_strdup (locale->territory_code), GINT_TO_POINTER (count));
25+ }
26 }
27 }
28
This page took 0.863921 seconds and 4 git commands to generate.