summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-03 23:18:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-03 23:18:39 +0000
commite91f833a2c7da961fc0742650eae391056d9ccc3 (patch)
tree53223d187c569f6ed2e14f27c780680c5c104775 /man.c
parentdf6217cca9ea17208578020a4733d898208dca31 (diff)
downloadmandoc-e91f833a2c7da961fc0742650eae391056d9ccc3.tar.gz
Allow the five man(7) font macros to concatenate their line arguments,
the same way the mdoc(7) macros marked MDOC_JOIN do it. In -Thtml, this removes bogus <br/> when the font macros are used in no-fill mode; issue found by jsg@ in the Xcursor(3) SYNOPSIS. As a bonus, this slightly reduces the size of the syntax tree.
Diffstat (limited to 'man.c')
-rw-r--r--man.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/man.c b/man.c
index ba1ed6b4..52eaaf91 100644
--- a/man.c
+++ b/man.c
@@ -315,6 +315,21 @@ man_word_alloc(struct man *man, int line, int pos, const char *word)
return(1);
}
+void
+man_word_append(struct man *man, const char *word)
+{
+ struct man_node *n;
+ char *addstr, *newstr;
+
+ n = man->last;
+ addstr = roff_strdup(man->roff, word);
+ mandoc_asprintf(&newstr, "%s %s", n->string, addstr);
+ free(addstr);
+ free(n->string);
+ n->string = newstr;
+ man->next = MAN_NEXT_SIBLING;
+}
+
/*
* Free all of the resources held by a node. This does NOT unlink a
* node from its context; for that, see man_node_unlink().