-/* $Id: mdoc.c,v 1.192 2011/07/27 07:09:41 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.195 2011/07/28 14:17:11 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
enum mdoct, enum mdoc_type);
static int node_append(struct mdoc *,
struct mdoc_node *);
+#if 0
static int mdoc_preptext(struct mdoc *, int, char *, int);
+#endif
static int mdoc_ptext(struct mdoc *, int, char *, int);
static int mdoc_pmacro(struct mdoc *, int, char *, int);
return(mandoc_getcontrol(buf, &offs) ?
mdoc_pmacro(m, ln, buf, offs) :
- mdoc_preptext(m, ln, buf, offs));
+ mdoc_ptext(m, ln, buf, offs));
}
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);
mdoc_node_free(p);
}
+#if 0
/*
* Pre-treat a text line.
* Text lines can consist of equations, which must be handled apart from
return(1);
}
+#endif
/*
* Parse free-form text, that is, a line that does not begin with the