aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/InitOutput.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-14 16:50:42 +0000
committermarha <marha@users.sourceforge.net>2011-02-14 16:50:42 +0000
commit9859910a8168b9c13e9e9952a03de91d51293484 (patch)
tree91c8ee0a8422b31223cbd607fc84299bc1f6ef1b /xorg-server/hw/xwin/InitOutput.c
parented5dd0a1f9eea43219b4c678ec062f614413eea2 (diff)
downloadvcxsrv-9859910a8168b9c13e9e9952a03de91d51293484.tar.gz
vcxsrv-9859910a8168b9c13e9e9952a03de91d51293484.tar.bz2
vcxsrv-9859910a8168b9c13e9e9952a03de91d51293484.zip
Only call XSupportsLocale in one place. Switch to a known locale when it fails
Diffstat (limited to 'xorg-server/hw/xwin/InitOutput.c')
-rw-r--r--xorg-server/hw/xwin/InitOutput.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c
index 8d5f4dbfb..8bdb18622 100644
--- a/xorg-server/hw/xwin/InitOutput.c
+++ b/xorg-server/hw/xwin/InitOutput.c
@@ -35,12 +35,10 @@ from The Open Group.
#include "winmsg.h"
#include "winconfig.h"
#include "winprefs.h"
-#ifdef XWIN_CLIPBOARD
-#include "X11/Xlocale.h"
-#endif
#ifdef DPMSExtension
#include "dpmsproc.h"
#endif
+#include <locale.h>
#ifdef __CYGWIN__
#include <mntent.h>
#endif
@@ -1024,7 +1022,17 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
* setlocale applies to all threads in the current process.
* Apply locale specified in LANG environment variable.
*/
- setlocale (LC_ALL, "");
+ if (!setlocale (LC_ALL, ""))
+ {
+ ErrorF ("setlocale failed.\n");
+ }
+
+ /* See if X supports the current locale */
+ if (XSupportsLocale () == FALSE)
+ {
+ ErrorF ("Warning: Locale not supported by X, falling back to 'C' locale.\n");
+ setlocale(LC_ALL, "C");
+ }
}
#endif