From 41956db132355f489a753f65915bb8fb6274c8e4 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Jun 24 2008 00:42:53 +0000 Subject: add patch --- diff --git a/gdm-2.20.5-fix-non-utf8.patch b/gdm-2.20.5-fix-non-utf8.patch new file mode 100644 index 0000000..3094ff2 --- /dev/null +++ b/gdm-2.20.5-fix-non-utf8.patch @@ -0,0 +1,39 @@ +diff -up gdm-2.20.5/common/gdm-common.c.fix-non-utf8 gdm-2.20.5/common/gdm-common.c +--- gdm-2.20.5/common/gdm-common.c.fix-non-utf8 2008-06-23 20:25:29.000000000 -0400 ++++ gdm-2.20.5/common/gdm-common.c 2008-06-23 20:27:53.000000000 -0400 +@@ -211,6 +211,26 @@ ve_get_first_working_command (const char + return ret; + } + ++static char * ++get_valid_utf8 (const char *text) ++{ ++ gchar *utf8_string, *escaped_string, *p; ++ const gchar *q; ++ ++ utf8_string = g_strdup (text); ++ p = utf8_string; ++ while ((*p != '\0') && ++ !g_utf8_validate (p, -1, &q)) { ++ p = (gchar *) q; ++ *p = '?'; ++ p++; ++ } ++ ++ g_assert (g_utf8_validate (utf8_string, -1, NULL)); ++ ++ return utf8_string; ++} ++ + char * + ve_locale_to_utf8 (const char *str) + { +@@ -218,7 +238,7 @@ ve_locale_to_utf8 (const char *str) + + if (ret == NULL) { + g_warning ("string not in proper locale encoding: \"%s\"", str); +- return g_strdup (str); ++ return get_valid_utf8 (str); + } else { + return ret; + }