diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-12-02 18:08:53 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-12-02 22:08:25 +0100 |
commit | 4f7d48aa24b20f92b3cd9438a446e345b849c39b (patch) | |
tree | 12a66f7c31f77d71b984bd5014f149c885f6e72b /htop.c | |
parent | b76eaf187a313c99fe008b069b8123b299752589 (diff) |
Set locale only once and do not override it later
Diffstat (limited to 'htop.c')
-rw-r--r-- | htop.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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, ""); |