summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcela Mašláňová <mmaslano@fedoraproject.org>2008-01-25 12:02:11 +0000
committerMarcela Mašláňová <mmaslano@fedoraproject.org>2008-01-25 12:02:11 +0000
commit133eb3b7813bcbb0ea76c10b290080359b2ff11b (patch)
treef36bb63c1ba931327b965db5c7e38c9dc4a8a5f4
parentb28e4aa8e20425d39bbccc516f678d45f9363dfa (diff)
nroff support -T optiongroff-1_18_1_4-8_fc7
-rw-r--r--groff.spec6
-rw-r--r--nroff63
2 files changed, 14 insertions, 55 deletions
diff --git a/groff.spec b/groff.spec
index 5679434..04334e8 100644
--- a/groff.spec
+++ b/groff.spec
@@ -3,7 +3,7 @@
Summary: A document formatting system
Name: groff
Version: 1.18.1.4
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPL
Group: Applications/Publishing
URL: http://groff.ffii.org
@@ -235,6 +235,10 @@ exit 0
%endif
%changelog
+* Fri Jan 25 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.18.1.4-8
+- nroff support -T option
+- Resolves: rhbz#428443
+
* Fri Oct 19 2007 Marcela Maslanova <mmaslano@redhat.com> - 1.18.1.4-7
- path to groffer wasn't set correct
- Resolves: rhbz#321431
diff --git a/nroff b/nroff
index 49a71bc..9cf5ae9 100644
--- a/nroff
+++ b/nroff
@@ -4,52 +4,8 @@
prog="$0"
charset_in=iso-8859-1
charset_out=`locale charmap 2>/dev/null`
-opts="-mtty-char -Tutf8"
-
-# 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 "`locale charmap 2>/dev/null`" in
- UTF-8)
- T=-Tutf8 ;;
- ISO-8859-1)
- T=-Tlatin1 ;;
- IBM-1047)
- T=-Tcp1047 ;;
- EUC-JP)
- T=-Tnippon ;;
- EUC-KR)
- T=-Tkorean ;;
- *)
- case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
- *.UTF-8)
- T=-Tutf8 ;;
- iso_8859_1 | *.ISO-8859-1)
- T=-Tlatin1 ;;
- *.IBM-1047)
- T=-Tcp1047 ;;
- ja_JP.ujis | ja_JP.eucJP)
- T=-Tnippon ;;
- ko_KR.eucKR)
- T=-Tkorean ;;
- *)
- case "$LESSCHARSET" in
- utf-8)
- T=-Tutf8 ;;
- latin1)
- T=-Tlatin1 ;;
- cp1047)
- T=-Tcp1047 ;;
- japanese)
- T=-Tnippon ;;
- ko)
- T=-Tkorean ;;
- *)
- T=-Tascii8 ;;
- esac ;;
- esac ;;
-esac
-
+opts="-mtty-char"
+T=""
for i
do
@@ -58,19 +14,15 @@ do
opts="$opts -P-c" ;;
-h)
opts="$opts -P-h" ;;
- -[eq] | -s*)
- # ignore these options
- ;;
-[mrnoT])
echo $"option $1 requires an argument" >&2
exit 1 ;;
-[iptSUC] | -[mrno]*)
opts="$opts $1" ;;
-Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean)
- opts=
T=$1 ;;
- -T*)
- # ignore other devices
+ -[eq] | -s* | -u* | -T*)
+ # ignore these options
;;
-v | --version)
echo $"GNU nroff (groff) with Red Hat i18n/l10n support"
@@ -95,6 +47,11 @@ do
shift
done
+# Don't convert encodings when -T is specified
+[ -n "$T" ] && exec /usr/bin/groff $opts $T ${1+"$@"} 2>/dev/null
+
+opts="$opts -Tutf8"
+
if TMPFILE=$(mktemp /tmp/man.XXXXXX 2>/dev/null); then
trap "rm -f $TMPFILE" 0 1 2 3 15
cat ${1+"$@"} >| $TMPFILE
@@ -120,7 +77,6 @@ export LC_ALL=en_US.UTF-8
# This shell script is intended for use with man, so warnings are
# probably not wanted. Also load nroff-style character definitions.
-
if [ $charset_in = utf-8 -a $charset_out = UTF-8 ]; then
if [ $TMPFILE = buf ]; then
echo -n "$buf" | /usr/bin/groff $opts 2>/dev/null
@@ -143,5 +99,4 @@ else
rm -f $TMPFILE
fi
fi
-
# eof