setlocale may return NULL, handle this case too by resetting to "C"

This commit is contained in:
Andrey A. Chernov 2000-09-01 11:13:38 +00:00
parent 016de69d9e
commit 460b926285
1 changed files with 3 additions and 5 deletions

View File

@ -107,11 +107,9 @@ int type;
} else {
if (type == NL_CAT_LOCALE)
lang = setlocale(LC_MESSAGES, NULL);
else {
if ((lang = (char *) getenv("LANG")) == NULL)
lang = "C";
}
if (strchr(lang, '/') != NULL)
else
lang = getenv("LANG");
if (lang == NULL || strchr(lang, '/') != NULL)
lang = "C";
if ((nlspath = (char *) getenv("NLSPATH")) == NULL
#ifndef __NETBSD_SYSCALLS