diff options
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 41 |
1 files changed, 1 insertions, 40 deletions
@@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.251 2015/04/23 15:35:59 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.252 2015/04/23 16:17:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -507,42 +507,3 @@ mdoc_isdelim(const char *p) return(DELIM_NONE); } - -void -mdoc_deroff(char **dest, const struct roff_node *n) -{ - char *cp; - size_t sz; - - if (n->type != ROFFT_TEXT) { - for (n = n->child; n; n = n->next) - mdoc_deroff(dest, n); - return; - } - - /* Skip leading whitespace. */ - - for (cp = n->string; '\0' != *cp; cp++) - if (0 == isspace((unsigned char)*cp)) - break; - - /* Skip trailing whitespace. */ - - for (sz = strlen(cp); sz; sz--) - if (0 == isspace((unsigned char)cp[sz-1])) - break; - - /* Skip empty strings. */ - - if (0 == sz) - return; - - if (NULL == *dest) { - *dest = mandoc_strndup(cp, sz); - return; - } - - mandoc_asprintf(&cp, "%s %*s", *dest, (int)sz, cp); - free(*dest); - *dest = cp; -} |