X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/28d410a5b5d16d8adbf96aaae4ef71d0ae938144..f2888f84e20ae452a6382db6d6f0888b1da41ef5:/mdoc.c diff --git a/mdoc.c b/mdoc.c index 2808326a..ee7c36dd 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.194 2011/07/27 12:43:02 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.197 2012/05/27 17:48:57 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -160,6 +160,7 @@ mdoc_alloc1(struct mdoc *mdoc) mdoc->last = mandoc_calloc(1, sizeof(struct mdoc_node)); mdoc->first = mdoc->last; mdoc->last->type = MDOC_ROOT; + mdoc->last->tok = MDOC_MAX; mdoc->next = MDOC_NEXT_CHILD; } @@ -196,13 +197,14 @@ mdoc_free(struct mdoc *mdoc) * Allocate volatile and non-volatile parse resources. */ struct mdoc * -mdoc_alloc(struct roff *roff, struct mparse *parse) +mdoc_alloc(struct roff *roff, struct mparse *parse, char *defos) { struct mdoc *p; p = mandoc_calloc(1, sizeof(struct mdoc)); p->parse = parse; + p->defos = defos; p->roff = roff; mdoc_hash_init(); @@ -570,7 +572,7 @@ mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) struct mdoc_node *n; n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT); - n->string = mandoc_strdup(p); + n->string = roff_strdup(m->roff, p); if ( ! node_append(m, n)) return(0);