summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-03-02 16:52:14 +0000
committerru <ru@FreeBSD.org>2001-03-02 16:52:14 +0000
commit3e8d7346e8d524380230b24dff5cb01becde964b (patch)
tree225fde80fe94b1fa2ce048160833bd1655dff767 /games
parenta79ec4865fc9fdfd8362a7fb93be50e7ff00c4f9 (diff)
downloadFreeBSD-src-3e8d7346e8d524380230b24dff5cb01becde964b.zip
FreeBSD-src-3e8d7346e8d524380230b24dff5cb01becde964b.tar.gz
setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.
Diffstat (limited to 'games')
-rw-r--r--games/morse/morse.62
-rw-r--r--games/morse/morse.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/games/morse/morse.6 b/games/morse/morse.6
index 42db42a..6b7f708 100644
--- a/games/morse/morse.6
+++ b/games/morse/morse.6
@@ -138,8 +138,8 @@ speaker device file
.El
.Sh ENVIRONMENT
.Bl -tag -width LC_CTYPE -compact
-.It Ev LC_CTYPE
.It Ev LC_ALL
+.It Ev LC_CTYPE
.It Ev LANG
If one of these variables (in this priority) is set to a locale ending in
.Ql KOI8-R ,
diff --git a/games/morse/morse.c b/games/morse/morse.c
index 38293a7..6579e8d 100644
--- a/games/morse/morse.c
+++ b/games/morse/morse.c
@@ -318,9 +318,9 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if((p = getenv("LC_CTYPE")) ||
- (p = getenv("LC_ALL")) ||
- (p = getenv("LANG"))) {
+ if(((p = getenv("LC_ALL")) && *p) ||
+ ((p = getenv("LC_CTYPE")) && *p) ||
+ ((p = getenv("LANG")) && *p)) {
if(strlen(p) >= sizeof(".KOI8-R") &&
strcasecmp(&p[strlen(p) + 1 - sizeof(".KOI8-R")], ".KOI8-R") == 0)
hightab = koi8rtab;
OpenPOWER on IntegriCloud