gdm r5861 - in trunk: . gui/simple-greeter



Author: halfline
Date: Mon Feb 25 21:38:58 2008
New Revision: 5861
URL: http://svn.gnome.org/viewvc/gdm?rev=5861&view=rev

Log:
2008-02-25  Ray Strode  <rstrode redhat com>

	* gui/simple-greeter/gdm-languages.c:
	(gdm_parse_language_name):
	If regex match returns empty string for one
	of the components of a locale, just free it
	and return NULL


Modified:
   trunk/ChangeLog
   trunk/gui/simple-greeter/gdm-languages.c

Modified: trunk/gui/simple-greeter/gdm-languages.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-languages.c	(original)
+++ trunk/gui/simple-greeter/gdm-languages.c	Mon Feb 25 21:38:58 2008
@@ -154,14 +154,32 @@
 
         if (territory_codep != NULL) {
                 *territory_codep = g_match_info_fetch_named (match_info, "territory");
+
+                if (*territory_codep != NULL &&
+                    *territory_codep[0] == '\0') {
+                        g_free (*territory_codep);
+                        *territory_codep = NULL;
+                }
         }
 
         if (codesetp != NULL) {
                 *codesetp = g_match_info_fetch_named (match_info, "codeset");
+
+                if (*codesetp != NULL &&
+                    *codesetp[0] == '\0') {
+                        g_free (*codesetp);
+                        *codesetp = NULL;
+                }
         }
 
         if (modifierp != NULL) {
                 *modifierp = g_match_info_fetch_named (match_info, "modifier");
+
+                if (*modifierp != NULL &&
+                    *modifierp[0] == '\0') {
+                        g_free (*modifierp);
+                        *modifierp = NULL;
+                }
         }
 
         g_match_info_free (match_info);



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