From 5eb83b0a99761db89faad2d224ae7c3c800f7d5b Mon Sep 17 00:00:00 2001 From: George Lebl Date: Fri, 28 May 2004 18:09:03 +0000 Subject: 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 * 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) --- utils/gdmopen.c | 11 +++++++++++ utils/gdmtranslate.c | 7 +++++++ 2 files changed, 18 insertions(+) (limited to 'utils') diff --git a/utils/gdmopen.c b/utils/gdmopen.c index f428296a..b49f51af 100644 --- a/utils/gdmopen.c +++ b/utils/gdmopen.c @@ -164,6 +164,17 @@ main (int argc, char *argv[]) if (child_pid == 0) { char VT_NUMBER[256]; + if (getenv ("UNSAFE_TO_TRANSLATE") != NULL && + strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) { + putenv ("LANG=C"); + + /* portable way to truly unset with putenv? */ + putenv ("LC_ALL="); + putenv ("LC_MESSAGES="); + putenv ("LC_ALL"); + putenv ("LC_MESSAGES"); + } + #ifdef __linux__ putenv ("TERM=linux"); #endif diff --git a/utils/gdmtranslate.c b/utils/gdmtranslate.c index da8aabb9..03814919 100644 --- a/utils/gdmtranslate.c +++ b/utils/gdmtranslate.c @@ -2,6 +2,7 @@ #include #include #include +#include #define gboolean char #define FALSE 0 @@ -32,6 +33,12 @@ main (int argc, char *argv[]) return 0; } + if (getenv ("UNSAFE_TO_TRANSLATE") != NULL && + strcmp (getenv ("UNSAFE_TO_TRANSLATE"), "yes") == 0) { + printf ("%s\n", string); + return 0; + } + setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); if (is_utf8) -- cgit v1.2.1