mirror of https://github.com/xzeldon/htop.git
Set locale only once and do not override it later
This commit is contained in:
parent
b76eaf187a
commit
4f7d48aa24
3
CRT.c
3
CRT.c
|
@ -725,9 +725,6 @@ void CRT_init(const int* delay, int colorScheme, bool allowUnicode) {
|
||||||
CRT_colorScheme = COLORSCHEME_MONOCHROME;
|
CRT_colorScheme = COLORSCHEME_MONOCHROME;
|
||||||
CRT_setColors(CRT_colorScheme);
|
CRT_setColors(CRT_colorScheme);
|
||||||
|
|
||||||
/* initialize locale */
|
|
||||||
setlocale(LC_CTYPE, "");
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSESW
|
#ifdef HAVE_LIBNCURSESW
|
||||||
if (allowUnicode && String_eq(nl_langinfo(CODESET), "UTF-8")) {
|
if (allowUnicode && String_eq(nl_langinfo(CODESET), "UTF-8")) {
|
||||||
CRT_utf8 = true;
|
CRT_utf8 = true;
|
||||||
|
|
7
htop.c
7
htop.c
|
@ -262,10 +262,9 @@ static void setCommFilter(State* state, char** commFilter) {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
char *lc_ctype = getenv("LC_CTYPE");
|
/* initialize locale */
|
||||||
if (lc_ctype != NULL)
|
const char* lc_ctype;
|
||||||
setlocale(LC_CTYPE, lc_ctype);
|
if ((lc_ctype = getenv("LC_CTYPE")) || (lc_ctype = getenv("LC_ALL")))
|
||||||
else if ((lc_ctype = getenv("LC_ALL")))
|
|
||||||
setlocale(LC_CTYPE, lc_ctype);
|
setlocale(LC_CTYPE, lc_ctype);
|
||||||
else
|
else
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
|
Loading…
Reference in New Issue