Commit 2d1d3074 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

If no language environment variable is defined, use "C" locale instead of "en_US".

[INTERPRETER]
* NEW: Add process id in warning messages.
* BUG: If no language environment variable is defined, use "C" locale instead of "en_US".
parent f0606b61
Pipeline #191026000 passed with stage
in 19 minutes and 25 seconds
......@@ -721,7 +721,7 @@ void ERROR_warning(const char *warning, ...)
fflush(NULL);
fprintf(stderr, "gbx" GAMBAS_VERSION_STRING ": warning: ");
fprintf(stderr, "gbx" GAMBAS_VERSION_STRING " [%d]: warning: ", getpid());
vfprintf(stderr, warning, args);
va_end(args);
......
......@@ -593,7 +593,7 @@ const char *LOCAL_get_lang(void)
if (!lang || !*lang)
lang = getenv("LANG");
if (!lang || !*lang)
lang = "en_US";
lang = "C";
_lang = STRING_new_zero(lang);
}
......@@ -610,7 +610,7 @@ void LOCAL_set_lang(const char *lang)
THROW(E_ARG);
#ifdef DEBUG_LANG
fprintf(stderr, "******** LOCAL_set_lang: %s ********\n", lang);
fprintf(stderr, "******** LOCAL_set_lang: %s\n", lang ? lang : "(null)");
#endif
if (lang && *lang)
......@@ -622,6 +622,10 @@ void LOCAL_set_lang(const char *lang)
STRING_free(&_lang);
lang = LOCAL_get_lang();
#ifdef DEBUG_LANG
fprintf(stderr, "lang = %s\n", lang);
#endif
my_setenv("LANG", lang, env_LANG);
my_setenv("LC_ALL", lang, env_LC_ALL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment