summaryrefslogtreecommitdiff
path: root/usr/src/cmd/mandoc/mdoc_man.c
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2018-08-09 15:17:53 +0300
committerRobert Mustacchi <rm@joyent.com>2018-08-10 16:17:24 +0000
commit6640c13beae5a8b03718dc6b7a9cda5dd6ab9024 (patch)
treebc4d8bf1793720d673715e41a87e0089ebdd9c4e /usr/src/cmd/mandoc/mdoc_man.c
parent9fd537180d8c7ca186c4842f6262016f5e418d10 (diff)
downloadillumos-joyent-6640c13beae5a8b03718dc6b7a9cda5dd6ab9024.tar.gz
9718 update mandoc to 1.14.4
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd/mandoc/mdoc_man.c')
-rw-r--r--usr/src/cmd/mandoc/mdoc_man.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/usr/src/cmd/mandoc/mdoc_man.c b/usr/src/cmd/mandoc/mdoc_man.c
index cf552ce902..bcf9207f79 100644
--- a/usr/src/cmd/mandoc/mdoc_man.c
+++ b/usr/src/cmd/mandoc/mdoc_man.c
@@ -1,6 +1,6 @@
-/* $Id: mdoc_man.c,v 1.122 2017/06/14 22:51:25 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.126 2018/04/11 17:11:13 schwarze Exp $ */
/*
- * Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -202,8 +202,8 @@ static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bx */
{ NULL, pre_skip, NULL, NULL, NULL }, /* Db */
{ NULL, NULL, NULL, NULL, NULL }, /* Dc */
- { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */
- { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Dq */
+ { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Do */
+ { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Dq */
{ NULL, NULL, NULL, NULL, NULL }, /* Ec */
{ NULL, NULL, NULL, NULL, NULL }, /* Ef */
{ NULL, pre_em, post_font, NULL, NULL }, /* Em */
@@ -610,6 +610,14 @@ man_mdoc(void *arg, const struct roff_man *mdoc)
{
struct roff_node *n;
+ printf(".\\\" Automatically generated from an mdoc input file."
+ " Do not edit.\n");
+ for (n = mdoc->first->child; n != NULL; n = n->next) {
+ if (n->type != ROFFT_COMMENT)
+ break;
+ printf(".\\\"%s\n", n->string);
+ }
+
printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n",
mdoc->meta.title,
(mdoc->meta.msec == NULL ? "" : mdoc->meta.msec),
@@ -624,7 +632,7 @@ man_mdoc(void *arg, const struct roff_man *mdoc)
fontqueue.head = fontqueue.tail = mandoc_malloc(8);
*fontqueue.tail = 'R';
}
- for (n = mdoc->first->child; n != NULL; n = n->next)
+ for (; n != NULL; n = n->next)
print_node(&mdoc->meta, n);
putchar('\n');
}
@@ -1408,7 +1416,7 @@ pre_it(DECL_ARGS)
if (bln->norm->Bl.type == LIST_diag)
print_line(".B \"", 0);
else
- print_line(".R \"", 0);
+ print_line(".BR \\& \"", 0);
outflags &= ~MMAN_spc;
return 1;
case LIST_bullet:
@@ -1547,7 +1555,6 @@ static int
pre_lk(DECL_ARGS)
{
const struct roff_node *link, *descr, *punct;
- int display;
if ((link = n->child) == NULL)
return 0;
@@ -1570,12 +1577,6 @@ pre_lk(DECL_ARGS)
}
/* Link target. */
- display = man_strlen(link->string) >= 26;
- if (display) {
- print_line(".RS", MMAN_Bk_susp);
- print_word("6n");
- outflags |= MMAN_nl;
- }
font_push('B');
print_word(link->string);
font_pop();
@@ -1585,8 +1586,6 @@ pre_lk(DECL_ARGS)
print_word(punct->string);
punct = punct->next;
}
- if (display)
- print_line(".RE", MMAN_nl);
return 0;
}