mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Set locale only once and do not override it later
This commit is contained in:

committed by
BenBE

parent
b76eaf187a
commit
4f7d48aa24
7
htop.c
7
htop.c
@ -262,10 +262,9 @@ static void setCommFilter(State* state, char** commFilter) {
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
char *lc_ctype = getenv("LC_CTYPE");
|
||||
if (lc_ctype != NULL)
|
||||
setlocale(LC_CTYPE, lc_ctype);
|
||||
else if ((lc_ctype = getenv("LC_ALL")))
|
||||
/* initialize locale */
|
||||
const char* lc_ctype;
|
||||
if ((lc_ctype = getenv("LC_CTYPE")) || (lc_ctype = getenv("LC_ALL")))
|
||||
setlocale(LC_CTYPE, lc_ctype);
|
||||
else
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
Reference in New Issue
Block a user