summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-09-18 15:54:48 +0000
committerschwarze <schwarze@openbsd.org>2011-09-18 15:54:48 +0000
commit04e980cb938b40da5e19a9a25cd7446a988ca5e4 (patch)
treebb18ce106a22da0ec77903ffdd6ad55da9ffa759 /usr.bin/mandoc/mdoc.c
parentSome fixes for the signal handling code. (diff)
downloadwireguard-openbsd-04e980cb938b40da5e19a9a25cd7446a988ca5e4.tar.xz
wireguard-openbsd-04e980cb938b40da5e19a9a25cd7446a988ca5e4.zip
sync to version 1.11.7 from kristaps@
main new feature: support the roff(7) .tr request plus various bugfixes and some refactoring regressions are so minor that it's better to get this in and fix them in the tree
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 6946e04fcf0..b02b169bb92 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.84 2011/09/18 10:25:28 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.85 2011/09/18 15:54:48 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -564,16 +564,9 @@ int
mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p)
{
struct mdoc_node *n;
- size_t sv, len;
-
- len = strlen(p);
n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT);
- n->string = mandoc_malloc(len + 1);
- sv = strlcpy(n->string, p, len + 1);
-
- /* Prohibit truncation. */
- assert(sv < len + 1);
+ n->string = roff_strdup(m->roff, p);
if ( ! node_append(m, n))
return(0);
@@ -755,11 +748,6 @@ mdoc_ptext(struct mdoc *m, int line, char *buf, int offs)
ws = NULL;
for (c = end = buf + offs; *c; c++) {
switch (*c) {
- case '-':
- if (mandoc_hyph(buf + offs, c))
- *c = ASCII_HYPH;
- ws = NULL;
- break;
case ' ':
if (NULL == ws)
ws = c;