aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mdoc.c b/mdoc.c
index c5cfef3c..228728fc 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc.c,v 1.204 2013/10/05 22:08:12 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.205 2013/10/21 23:47:58 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012, 2013 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
@@ -582,6 +582,23 @@ mdoc_word_alloc(struct mdoc *mdoc, int line, int pos, const char *p)
return(1);
}
+void
+mdoc_word_append(struct mdoc *mdoc, const char *p)
+{
+ struct mdoc_node *n;
+ char *addstr, *newstr;
+
+ n = mdoc->last;
+ addstr = roff_strdup(mdoc->roff, p);
+ if (-1 == asprintf(&newstr, "%s %s", n->string, addstr)) {
+ perror(NULL);
+ exit((int)MANDOCLEVEL_SYSERR);
+ }
+ free(addstr);
+ free(n->string);
+ n->string = newstr;
+ mdoc->next = MDOC_NEXT_SIBLING;
+}
static void
mdoc_node_free(struct mdoc_node *p)