aboutsummaryrefslogtreecommitdiff
path: root/games/morse
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-03-02 16:52:14 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-03-02 16:52:14 +0000
commitafcf05e46aacbe58f9fd8338ab6ecf9b7d06d004 (patch)
tree4d1655d724be575f060459c555ab30a5630ec3e9 /games/morse
parent7a6be913664526370f69f43e340b7ed33f20ea8f (diff)
downloadsrc-afcf05e46aacbe58f9fd8338ab6ecf9b7d06d004.tar.gz
src-afcf05e46aacbe58f9fd8338ab6ecf9b7d06d004.zip
setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.
Notes
Notes: svn path=/head/; revision=73349
Diffstat (limited to 'games/morse')
-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 42db42aa02dd..6b7f70835f35 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 38293a73702e..6579e8dd020c 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;