summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-02-13 16:15:04 +0000
committerru <ru@FreeBSD.org>2001-02-13 16:15:04 +0000
commit2934fc23653f64b32f4db32233d7eda11ca274f0 (patch)
tree9516c6163fafe4542c874538b68260aa5cdc5d90 /gnu
parent83025d71990a74816b7b973ef4249add3cf218be (diff)
downloadFreeBSD-src-2934fc23653f64b32f4db32233d7eda11ca274f0.zip
FreeBSD-src-2934fc23653f64b32f4db32233d7eda11ca274f0.tar.gz
Make it possible for any given locale to use different
groff(1) devices for localized and non-localized pages. Currently, for *.ISO_8859-1 locales the device in both cases is "latin1", and for KOI8-R locale it is "koi8-r" for localized and "ascii" for non-localized pages. Discussed with: des
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/man/man/man.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c
index 250cae4..dd83afc 100644
--- a/gnu/usr.bin/man/man/man.c
+++ b/gnu/usr.bin/man/man/man.c
@@ -93,16 +93,17 @@ static char *alt_system_name;
#ifdef __FreeBSD__
/* short_locale without country suffix */
static char *locale, *short_locale;
-static char *locale_nroff = " -Tascii";
+static char *roff_dev = "ascii", *roff_ldev = "ascii";
static int use_original;
struct ltable {
char *lcode;
- char *nroff;
+ char *ldev; /* roff device for localized manpages. */
+ char *odev; /* roff device for original manpages. */
};
static struct ltable ltable[] = {
- {"KOI8-R", " -Tkoi8-r"},
- {"ISO_8859-1", " -Tlatin1"},
- {NULL, NULL}
+ {"KOI8-R", "koi8-r", "ascii"},
+ {"ISO_8859-1", "latin1", "latin1"},
+ {NULL}
};
#endif
@@ -481,7 +482,8 @@ man_getopt (argc, argv)
tmp = short_locale + 3;
for (pltable = ltable; pltable->lcode != NULL; pltable++) {
if (strcmp(pltable->lcode, tmp) == 0) {
- locale_nroff = pltable->nroff;
+ roff_ldev = pltable->ldev;
+ roff_dev = pltable->odev;
break;
}
}
@@ -947,7 +949,7 @@ parse_roff_directive (cp, file, buf, bufsize)
#ifdef __FreeBSD__
char lbuf[FILENAME_MAX];
- snprintf(lbuf, sizeof(lbuf), "%s%s", NEQN, locale_nroff);
+ snprintf(lbuf, sizeof(lbuf), "%s -T%s", NEQN, roff_dev);
add_directive (&first, lbuf, file, buf, bufsize);
#else
add_directive (&first, NEQN, file, buf, bufsize);
@@ -1025,7 +1027,7 @@ parse_roff_directive (cp, file, buf, bufsize)
#ifdef __FreeBSD__
char lbuf[FILENAME_MAX];
- snprintf(lbuf, sizeof(lbuf), "%s%s", NROFF, locale_nroff);
+ snprintf(lbuf, sizeof(lbuf), "%s -T%s", NROFF, roff_dev);
add_directive (&first, lbuf, file, buf, bufsize);
#else
add_directive (&first, NROFF " -Tascii", file, buf, bufsize);
@@ -1571,6 +1573,7 @@ man (name)
#ifdef __FreeBSD__
int l_found;
char buf[FILENAME_MAX];
+ char *roff_odev;
#endif
found = 0;
@@ -1588,6 +1591,8 @@ man (name)
#ifdef __FreeBSD__
l_found = 0;
if (locale != NULL) {
+ roff_odev = roff_dev;
+ roff_dev = roff_ldev;
snprintf(buf, sizeof(buf), "%s/%s", *mp, locale);
if (is_directory (buf))
l_found = try_section (buf, section, name, glob);
@@ -1596,6 +1601,7 @@ man (name)
if (is_directory (buf))
l_found = try_section (buf, section, name, glob);
}
+ roff_dev = roff_odev;
}
if (!l_found) {
#endif
@@ -1623,6 +1629,8 @@ man (name)
#ifdef __FreeBSD__
l_found = 0;
if (locale != NULL) {
+ roff_odev = roff_dev;
+ roff_dev = roff_ldev;
snprintf(buf, sizeof(buf), "%s/%s", *mp, locale);
if (is_directory (buf))
l_found = try_section (buf, *sp, name, glob);
@@ -1631,6 +1639,7 @@ man (name)
if (is_directory (buf))
l_found = try_section (buf, *sp, name, glob);
}
+ roff_dev = roff_odev;
}
if (!l_found) {
#endif
OpenPOWER on IntegriCloud