File nroff-empty-LANGUAGE-fix.diff of Package groff

---
 src/roff/nroff/nroff.sh |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

--- a/src/roff/nroff/nroff.sh
+++ b/src/roff/nroff/nroff.sh
@@ -203,10 +203,22 @@
 #    mv $TMPDIR/input.new $TMPDIR/input
 #fi
 
+getlang () {
+    if [ -n "$LANGUAGE" ]; then
+	echo $LANGUAGE
+    elif [ -n "$LC_ALL" ]; then
+	echo $LC_ALL
+    elif [ -n "$LC_MESSAGES" ]; then
+	echo $LC_MESSAGES
+    else
+	echo $LANG
+    fi
+}
+
 ICONV="cat"
 case "`locale charmap 2>/dev/null`" in
     UTF-8)
-    case "${LANGUAGE-${LC_ALL-${LC_MESSAGES-${LANG}}}}" in
+    case `getlang` in
         ja*)
         # Japanese man page in UTF-8 locale, special case!
         # force the device 'nippon' to run groff in ja_JP.eucJP locale
openSUSE Build Service is sponsored by