diff options
author | ache <ache@FreeBSD.org> | 2000-09-01 10:54:04 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-09-01 10:54:04 +0000 |
commit | c023c260fca236fad832b9e5c52f39ad6ec597d8 (patch) | |
tree | 972237ac55cfc39cecdb33850b3358e7c63acff0 /lib/libc | |
parent | fabc2a69f04ab1e89937bbf805e940a72f6cfcaf (diff) | |
download | FreeBSD-src-c023c260fca236fad832b9e5c52f39ad6ec597d8.zip FreeBSD-src-c023c260fca236fad832b9e5c52f39ad6ec597d8.tar.gz |
Protect from badly formed LANG variable
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/nls/msgcat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index cb61b14..5632ad3 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -108,7 +108,8 @@ int type; if (type == NL_CAT_LOCALE) lang = setlocale(LC_MESSAGES, NULL); else { - if ((lang = (char *) getenv("LANG")) == NULL) + if ((lang = (char *) getenv("LANG")) == NULL || + strchr(lang, '/') != NULL) lang = "C"; } if ((nlspath = (char *) getenv("NLSPATH")) == NULL |