]> git.pld-linux.org Git - packages/gnome-control-center.git/blob - territory_code.patch
- updated to 46.1
[packages/gnome-control-center.git] / territory_code.patch
1 commit cbda9c4c6bbbeff84895f9fefb61cdc90129c68b
2 Author: Artur Frysiak <wiget@pld-linux.org>
3 Date:   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
10 diff --git a/panels/common/gdm-languages.c b/panels/common/gdm-languages.c
11 index 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.503757 seconds and 3 git commands to generate.