Print this page
9718 update mandoc to 1.14.4
@@ -1,8 +1,8 @@
-/* $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
* copyright notice and this permission notice appear in all copies.
*
@@ -200,12 +200,12 @@
{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */
{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bsx */
{ 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 */
{ cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */
{ NULL, pre_bk, post_bk, NULL, NULL }, /* Fx */
@@ -608,10 +608,18 @@
void
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),
mdoc->meta.date, mdoc->meta.os, mdoc->meta.vol);
@@ -622,11 +630,11 @@
if (0 == fontqueue.size) {
fontqueue.size = 8;
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');
}
static void
@@ -1406,11 +1414,11 @@
case LIST_diag:
case LIST_ohang:
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:
case LIST_dash:
case LIST_hyphen:
@@ -1545,11 +1553,10 @@
static int
pre_lk(DECL_ARGS)
{
const struct roff_node *link, *descr, *punct;
- int display;
if ((link = n->child) == NULL)
return 0;
/* Find beginning of trailing punctuation. */
@@ -1568,27 +1575,19 @@
font_pop();
print_word(":");
}
/* 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();
/* Trailing punctuation. */
while (punct != NULL) {
print_word(punct->string);
punct = punct->next;
}
- if (display)
- print_line(".RE", MMAN_nl);
return 0;
}
static void
pre_onearg(DECL_ARGS)