From 570b884a913ba6a94be4cb30c6d39915256fe27b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Nov 2014 23:18:39 +0000 Subject: 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
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. --- man.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'man.c') diff --git a/man.c b/man.c index 66c6c3e6..dedf62e7 100644 --- a/man.c +++ b/man.c @@ -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 * Copyright (c) 2013, 2014 Ingo Schwarze @@ -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(). -- cgit v1.2.3-56-ge451