Lines 5-11
Link Here
|
5 |
# Default device. |
5 |
# Default device. |
6 |
# First try the "locale charmap" command, because it's most reliable. |
6 |
# First try the "locale charmap" command, because it's most reliable. |
7 |
# On systems where it doesn't exist, look at the environment variables. |
7 |
# On systems where it doesn't exist, look at the environment variables. |
8 |
case "`exec 2>/dev/null ; locale charmap`" in |
8 |
out_locale="`exec 2>/dev/null ; locale charmap`" |
|
|
9 |
case ${out_locale} in |
9 |
UTF-8) |
10 |
UTF-8) |
10 |
T=-Tutf8 ;; |
11 |
T=-Tutf8 ;; |
11 |
ISO-8859-1 | ISO-8859-15) |
12 |
ISO-8859-1 | ISO-8859-15) |
Lines 35-40
Link Here
|
35 |
esac ;; |
36 |
esac ;; |
36 |
esac |
37 |
esac |
37 |
opts= |
38 |
opts= |
|
|
39 |
manpage= |
38 |
|
40 |
|
39 |
# `for i; do' doesn't work with some versions of sh |
41 |
# `for i; do' doesn't work with some versions of sh |
40 |
|
42 |
|
Lines 53-58
Link Here
|
53 |
exit 1 ;; |
55 |
exit 1 ;; |
54 |
-[iptSUC] | -[dMmrno]*) |
56 |
-[iptSUC] | -[dMmrno]*) |
55 |
opts="$opts $1" ;; |
57 |
opts="$opts $1" ;; |
|
|
58 |
--manpage) |
59 |
manpage=yes ;; |
56 |
-Tascii | -Tlatin1 | -Tutf8 | -Tcp1047) |
60 |
-Tascii | -Tlatin1 | -Tutf8 | -Tcp1047) |
57 |
T=$1 ;; |
61 |
T=$1 ;; |
58 |
-T*) |
62 |
-T*) |
Lines 69-75
Link Here
|
69 |
exit 0 ;; |
73 |
exit 0 ;; |
70 |
--help) |
74 |
--help) |
71 |
echo "usage: nroff [-CchipStUv] [-dCS] [-MDIR] [-mNAME] [-nNUM] [-oLIST]" |
75 |
echo "usage: nroff [-CchipStUv] [-dCS] [-MDIR] [-mNAME] [-nNUM] [-oLIST]" |
72 |
echo " [-rCN] [-Tname] [FILE...]" |
76 |
echo " [-rCN] [-Tname] [--manpage] [FILE...]" |
73 |
exit 0 ;; |
77 |
exit 0 ;; |
74 |
--) |
78 |
--) |
75 |
shift |
79 |
shift |
Lines 91-99
Link Here
|
91 |
@GROFF_BIN_PATH_SETUP@ |
95 |
@GROFF_BIN_PATH_SETUP@ |
92 |
export GROFF_BIN_PATH |
96 |
export GROFF_BIN_PATH |
93 |
|
97 |
|
|
|
98 |
in_locale=${out_locale} |
99 |
if [ ${manpage} ]; then |
100 |
case "`exec 2>/dev/null ; locale language`" in |
101 |
Russian) |
102 |
in_locale="KOI8-R" ;; |
103 |
esac |
104 |
T=-Tlatin1 |
105 |
fi |
106 |
|
94 |
# This shell script is intended for use with man, so warnings are |
107 |
# This shell script is intended for use with man, so warnings are |
95 |
# probably not wanted. Also load nroff-style character definitions. |
108 |
# probably not wanted. Also load nroff-style character definitions. |
96 |
|
109 |
|
97 |
PATH="$GROFF_RUNTIME$PATH" groff -mtty-char $T $opts ${1+"$@"} |
110 |
PATH="$GROFF_RUNTIME$PATH" groff -mtty-char $T $opts ${1+"$@"} | \ |
|
|
111 |
iconv -f ${in_locale} -t ${out_locale} |
98 |
|
112 |
|
99 |
# eof |
113 |
# eof |