Ignore LC_ALL and LC_CTYPE if they are empty as well as unset.

This commit is contained in:
Nicholas Marriott 2011-10-23 08:03:27 +00:00
parent 16d75a6bf2
commit b32254acda

4
tmux.c
View File

@ -289,8 +289,8 @@ main(int argc, char **argv)
* if not they know that output from UTF-8-capable programs may
* be wrong.
*/
if ((s = getenv("LC_ALL")) == NULL) {
if ((s = getenv("LC_CTYPE")) == NULL)
if ((s = getenv("LC_ALL")) == NULL || *s == '\0') {
if ((s = getenv("LC_CTYPE")) == NULL || *s == '\0')
s = getenv("LANG");
}
if (s != NULL && (strcasestr(s, "UTF-8") != NULL ||