From 3381bcccce951f0ca40a1a39f5c568435a35fcd2 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 19 Aug 2009 11:58:32 +0000 Subject: Moved MDOC_NEXT_SIBLING into mdoc_word (libmdoc). De-chunking of word terms in libman. --- mdoc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'mdoc.c') diff --git a/mdoc.c b/mdoc.c index 045fe792..ed219096 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.100 2009/08/18 14:27:16 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.101 2009/08/19 11:58:32 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -543,7 +543,10 @@ pstring(struct mdoc *m, int line, int pos, const char *p, size_t len) /* Prohibit truncation. */ assert(sv < len + 1); - return(node_append(m, n)); + if ( ! node_append(m, n)) + return(0); + m->next = MDOC_NEXT_SIBLING; + return(1); } @@ -600,12 +603,8 @@ parsetext(struct mdoc *m, int line, char *buf) * back-end, as it should be preserved as a single term. */ - if (MDOC_LITERAL & m->flags) { - if ( ! mdoc_word_alloc(m, line, 0, buf)) - return(0); - m->next = MDOC_NEXT_SIBLING; - return(1); - } + if (MDOC_LITERAL & m->flags) + return(mdoc_word_alloc(m, line, 0, buf)); /* Disallow blank/white-space lines in non-literal mode. */ @@ -630,7 +629,6 @@ parsetext(struct mdoc *m, int line, char *buf) buf[i++] = 0; if ( ! pstring(m, line, j, &buf[j], (size_t)(i - j))) return(0); - m->next = MDOC_NEXT_SIBLING; for ( ; ' ' == buf[i]; i++) /* Skip trailing whitespace. */ ; -- cgit v1.2.3