summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 11:58:32 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 11:58:32 +0000
commit3381bcccce951f0ca40a1a39f5c568435a35fcd2 (patch)
tree020fb2b2cbec0101e4717139d225fd54e8f7353b /mdoc.c
parentc9504b71ac277515894a09ceb4aa9640eba6ccf2 (diff)
downloadmandoc-3381bcccce951f0ca40a1a39f5c568435a35fcd2.tar.gz
mandoc-3381bcccce951f0ca40a1a39f5c568435a35fcd2.tar.zst
mandoc-3381bcccce951f0ca40a1a39f5c568435a35fcd2.zip
Moved MDOC_NEXT_SIBLING into mdoc_word (libmdoc).
De-chunking of word terms in libman.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c16
1 files changed, 7 insertions, 9 deletions
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 <kristaps@kth.se>
*
@@ -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. */ ;