From dfb33229a0e6cbd0e2f723c32c39aa05d8cae693 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 15 Sep 1997 02:03:13 +0000 Subject: [PATCH] Sense *.ISO_8859-1 and *.KOI8-R locales from environment PR: 4290 Submitted by: "Anatoly A. Orehovsky" --- contrib/groff/eqn/neqn.sh | 17 ++++++++++++++++- contrib/groff/src/preproc/eqn/neqn.sh | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/contrib/groff/eqn/neqn.sh b/contrib/groff/eqn/neqn.sh index 770376732b29..cc32e66406b3 100644 --- a/contrib/groff/eqn/neqn.sh +++ b/contrib/groff/eqn/neqn.sh @@ -2,4 +2,19 @@ # Provision of this shell script should not be taken to imply that use of # GNU eqn with groff -Tascii|-Tlatin1 is supported. -exec @g@eqn -Tascii ${1+"$@"} +# Default device. +if test `expr "$LC_CTYPE" : ".*\.ISO_8859-1"` -gt 0 || \ + test `expr "$LANG" : ".*\.ISO_8859-1"` -gt 0 +then + T=-Tlatin1 +else +if test `expr "$LC_CTYPE" : ".*\.KOI8-R"` -gt 0 || \ + test `expr "$LANG" : ".*\.KOI8-R"` -gt 0 +then + T=-Tkoi8-r +else + T=-Tascii +fi +fi + +exec @g@eqn -T${T} ${1+"$@"} diff --git a/contrib/groff/src/preproc/eqn/neqn.sh b/contrib/groff/src/preproc/eqn/neqn.sh index 770376732b29..cc32e66406b3 100644 --- a/contrib/groff/src/preproc/eqn/neqn.sh +++ b/contrib/groff/src/preproc/eqn/neqn.sh @@ -2,4 +2,19 @@ # Provision of this shell script should not be taken to imply that use of # GNU eqn with groff -Tascii|-Tlatin1 is supported. -exec @g@eqn -Tascii ${1+"$@"} +# Default device. +if test `expr "$LC_CTYPE" : ".*\.ISO_8859-1"` -gt 0 || \ + test `expr "$LANG" : ".*\.ISO_8859-1"` -gt 0 +then + T=-Tlatin1 +else +if test `expr "$LC_CTYPE" : ".*\.KOI8-R"` -gt 0 || \ + test `expr "$LANG" : ".*\.KOI8-R"` -gt 0 +then + T=-Tkoi8-r +else + T=-Tascii +fi +fi + +exec @g@eqn -T${T} ${1+"$@"}