summaryrefslogtreecommitdiff
path: root/daemon/misc.c
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2004-05-28 18:09:03 +0000
committerGeorge Lebl <jirka@src.gnome.org>2004-05-28 18:09:03 +0000
commit5eb83b0a99761db89faad2d224ae7c3c800f7d5b (patch)
tree1aea04ed91c203e8c44da65f48e9b142bc35f74a /daemon/misc.c
parentb11360cc0320f8732aa84db81c84b66ac31d1d9c (diff)
downloadgdm-5eb83b0a99761db89faad2d224ae7c3c800f7d5b.tar.gz
eek, evil we had GETTEXT_PACKAGE set to gdm-2.4, but we want gdm-2.6
Fri May 28 11:08:51 2004 George Lebl <jirka@5z.com> * configure.in: eek, evil we had GETTEXT_PACKAGE set to gdm-2.4, but we want gdm-2.6 nowdays * daemon/gdm.c, daemon/misc.c: fix the ConsoleCannotHandle key and cache it as soon as we can and also set UNSAFE_TO_TRANSLATE=yes when forking something and console can't handle the language * daemon/server.c: fix a minor fd leak and print a C locale (don't want to translate this) error to the X log when the X server cannot be exec'ed. * utils/gdmopen.c, utils/gdmtranslate.c, config/XKeepsCrashing: Listen to UNSAFE_TO_TRANSLATE, since running shells in login mode may modify the locale so we must force it to "C" where we can if it is really unsafe (language in ConsoleCannotHandle)
Diffstat (limited to 'daemon/misc.c')
-rw-r--r--daemon/misc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/daemon/misc.c b/daemon/misc.c
index e45b6e5a..b9c833fa 100644
--- a/daemon/misc.c
+++ b/daemon/misc.c
@@ -512,6 +512,7 @@ gdm_text_message_dialog (const char *msg)
ve_unsetenv ("LC_ALL");
ve_unsetenv ("LC_MESSAGES");
ve_setenv ("LANG", "C", TRUE);
+ ve_setenv ("UNSAFE_TO_TRANSLATE", "yes", TRUE);
}
argv[0] = EXPANDED_LIBEXECDIR "/gdmopen";
@@ -593,6 +594,7 @@ gdm_text_yesno_dialog (const char *msg, gboolean *ret)
ve_unsetenv ("LC_ALL");
ve_unsetenv ("LC_MESSAGES");
ve_setenv ("LANG", "C", TRUE);
+ ve_setenv ("UNSAFE_TO_TRANSLATE", "yes", TRUE);
}
argv[0] = EXPANDED_LIBEXECDIR "/gdmopen";
@@ -2334,6 +2336,10 @@ gdm_ok_console_language (void)
if (cached)
return is_ok;
+ /* so far we should be paranoid, we're not set yet */
+ if (GdmConsoleCannotHandle == NULL)
+ return FALSE;
+
cached = TRUE;
loc = setlocale (LC_MESSAGES, NULL);
@@ -2342,19 +2348,20 @@ gdm_ok_console_language (void)
return TRUE;
}
+ is_ok = TRUE;
+
v = g_strsplit (GdmConsoleCannotHandle, ",", -1);
for (i = 0; v != NULL && v[i] != NULL; i++) {
if ( ! ve_string_empty (v[i]) &&
strncmp (v[i], loc, strlen (v[i])) == 0) {
is_ok = FALSE;
- return FALSE;
+ break;
}
}
if (v != NULL)
g_strfreev (v);
- is_ok = TRUE;
- return TRUE;
+ return is_ok;
}
const char *