--- groff-1.19.2/src/roff/nroff/nroff.sh.fix 2006-08-16 18:06:42 +0400 +++ groff-1.19.2/src/roff/nroff/nroff.sh 2006-08-16 18:07:55 +0400 @@ -1,44 +1,27 @@ #! /bin/sh # Emulate nroff with groff. prog="$0" +T= +set_device() +{ # Default device. # First try the "locale charmap" command, because it's most reliable. # On systems where it doesn't exist, look at the environment variables. case "`exec 2>/dev/null ; locale charmap`" in UTF-8) T=-Tutf8 ;; - ISO-8859-1 | ISO-8859-15) - T=-Tlatin1 ;; IBM-1047) T=-Tcp1047 ;; - *) - case "${LC_ALL-${LC_CTYPE-${LANG}}}" in - *.UTF-8) - T=-Tutf8 ;; - iso_8859_1 | *.ISO-8859-1 | *.ISO8859-1 | \ - iso_8859_15 | *.ISO-8859-15 | *.ISO8859-15) - T=-Tlatin1 ;; - *.IBM-1047) - T=-Tcp1047 ;; - *) - case "$LESSCHARSET" in - utf-8) - T=-Tutf8 ;; - latin1) - T=-Tlatin1 ;; - cp1047) - T=-Tcp1047 ;; - *) - T=-Tascii ;; - esac ;; - esac ;; + *) + T=-Tlatin1 ;; esac +} opts= # `for i; do' doesn't work with some versions of sh for i do case $1 in -c) @@ -86,14 +69,16 @@ for i done # Set up the `GROFF_BIN_PATH' variable # to be exported in the current `GROFF_RUNTIME' environment. @GROFF_BIN_PATH_SETUP@ export GROFF_BIN_PATH +[ -n "$T" ] || set_device + # This shell script is intended for use with man, so warnings are # probably not wanted. Also load nroff-style character definitions. PATH="$GROFF_RUNTIME$PATH" groff -mtty-char $T $opts ${1+"$@"} # eof