diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-03 23:18:39 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-03 23:18:39 +0000 |
commit | 570b884a913ba6a94be4cb30c6d39915256fe27b (patch) | |
tree | 07159a711f99102cdc319492c1740655d16665d7 /man.c | |
parent | 690ce2ee67ae7b62772ac42f54c2c4df976bbbd0 (diff) | |
download | mandoc-570b884a913ba6a94be4cb30c6d39915256fe27b.tar.gz mandoc-570b884a913ba6a94be4cb30c6d39915256fe27b.tar.zst mandoc-570b884a913ba6a94be4cb30c6d39915256fe27b.zip |
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.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.141 2014/10/20 15:50:24 schwarze Exp $ */ +/* $Id: man.c,v 1.142 2014/11/03 23:18:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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(). |