summaryrefslogtreecommitdiff
path: root/utils
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 /utils
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 'utils')
-rw-r--r--utils/gdmopen.c11
-rw-r--r--utils/gdmtranslate.c7
2 files changed, 18 insertions, 0 deletions
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 <stdio.h>
#include <locale.h>
#include <string.h>
+#include <stdlib.h>
#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)