initialize locale for LC_CTYPE only

htop uses scanf functions to parse values from proc filesystem. This
breaks when initializing locale for LC_NUMERIC because of unexpected
commas. So initialize locale for LC_CTYPE only.
This commit is contained in:
Christian Hesse 2015-07-29 11:28:15 +02:00
parent 77df258636
commit cea591181d
1 changed files with 1 additions and 1 deletions

2
CRT.c
View File

@ -587,7 +587,7 @@ void CRT_init(int delay, int colorScheme) {
CRT_setColors(CRT_colorScheme); CRT_setColors(CRT_colorScheme);
/* initialize locale */ /* initialize locale */
setlocale(LC_ALL, ""); setlocale(LC_CTYPE, "");
#ifdef HAVE_LIBNCURSESW #ifdef HAVE_LIBNCURSESW
if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0) if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0)