From 6d6d58240aa1eb465f7961a247378634a433d56f Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 29 May 2017 13:00:18 -0400 Subject: [PATCH] C locale fix --- linux_4ed.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/linux_4ed.cpp b/linux_4ed.cpp index 05a69625..27bc619f 100644 --- a/linux_4ed.cpp +++ b/linux_4ed.cpp @@ -1739,22 +1739,15 @@ LinuxInputInit(Display *dpy, Window XWindow){ XIMStyle style; unsigned long xim_event_mask = 0; - char *prev_locale = setlocale(LC_ALL, ""); - char *prev_modifiers = XSetLocaleModifiers(""); + setlocale(LC_ALL, ""); + XSetLocaleModifiers(""); b32 locale_supported = XSupportsLocale(); fprintf(stderr, "Supported locale?: %s.\n", locale_supported ? "Yes" : "No"); if (!locale_supported){ - fprintf(stderr, "Previous locale was %s\n", prev_locale); - fprintf(stderr, "Previous modifiers were %s\n", prev_modifiers); - fprintf(stderr, "Reverting to previous locale setup ... "); - if (prev_locale != 0){ - setlocale(LC_ALL, prev_locale); - } - if (prev_modifiers != 0){ - XSetLocaleModifiers(prev_modifiers); - } + fprintf(stderr, "Reverting to 'C' ... "); + setlocale(LC_ALL, "C"); locale_supported = XSupportsLocale(); - fprintf(stderr, "Previous is supported? %s.\n", locale_supported ? "Yes" : "No"); + fprintf(stderr, "C is supported? %s.\n", locale_supported ? "Yes" : "No"); } result.input_method = XOpenIM(dpy, 0, 0, 0);