=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/mandoc/mdoc.c 2009/08/22 19:43:33 1.24 --- src/usr.bin/mandoc/mdoc.c 2009/08/22 21:55:06 1.25 *************** *** 1,4 **** ! /* $Id: mdoc.c,v 1.24 2009/08/22 19:43:33 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc.c,v 1.25 2009/08/22 21:55:06 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 455,461 **** p = node_alloc(m, line, pos, tok, MDOC_TAIL); if (NULL == p) return(0); ! return(node_append(m, p)); } --- 455,464 ---- p = node_alloc(m, line, pos, tok, MDOC_TAIL); if (NULL == p) return(0); ! if ( ! node_append(m, p)) ! return(0); ! m->next = MDOC_NEXT_CHILD; ! return(1); } *************** *** 470,476 **** p = node_alloc(m, line, pos, tok, MDOC_HEAD); if (NULL == p) return(0); ! return(node_append(m, p)); } --- 473,482 ---- p = node_alloc(m, line, pos, tok, MDOC_HEAD); if (NULL == p) return(0); ! if ( ! node_append(m, p)) ! return(0); ! m->next = MDOC_NEXT_CHILD; ! return(1); } *************** *** 482,488 **** p = node_alloc(m, line, pos, tok, MDOC_BODY); if (NULL == p) return(0); ! return(node_append(m, p)); } --- 488,497 ---- p = node_alloc(m, line, pos, tok, MDOC_BODY); if (NULL == p) return(0); ! if ( ! node_append(m, p)) ! return(0); ! m->next = MDOC_NEXT_CHILD; ! return(1); } *************** *** 498,504 **** p->args = args; if (p->args) (args->refcnt)++; ! return(node_append(m, p)); } --- 507,516 ---- p->args = args; if (p->args) (args->refcnt)++; ! if ( ! node_append(m, p)) ! return(0); ! m->next = MDOC_NEXT_CHILD; ! return(1); } *************** *** 514,520 **** p->args = args; if (p->args) (args->refcnt)++; ! return(node_append(m, p)); } --- 526,535 ---- p->args = args; if (p->args) (args->refcnt)++; ! if ( ! node_append(m, p)) ! return(0); ! m->next = MDOC_NEXT_CHILD; ! return(1); } *************** *** 539,545 **** /* Prohibit truncation. */ assert(sv < len + 1); ! return(node_append(m, n)); } --- 554,563 ---- /* Prohibit truncation. */ assert(sv < len + 1); ! if ( ! node_append(m, n)) ! return(0); ! m->next = MDOC_NEXT_SIBLING; ! return(1); } *************** *** 596,607 **** * 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); ! } /* Disallow blank/white-space lines in non-literal mode. */ --- 614,621 ---- * back-end, as it should be preserved as a single term. */ ! if (MDOC_LITERAL & m->flags) ! return(mdoc_word_alloc(m, line, 0, buf)); /* Disallow blank/white-space lines in non-literal mode. */ *************** *** 626,632 **** 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. */ ; --- 640,645 ---- *************** *** 665,671 **** int parsemacro(struct mdoc *m, int ln, char *buf) { ! int i, j, c, ppos; char mac[5]; /* Empty lines are ignored. */ --- 678,684 ---- int parsemacro(struct mdoc *m, int ln, char *buf) { ! int i, j, c; char mac[5]; /* Empty lines are ignored. */ *************** *** 685,692 **** return(1); } - ppos = i; - /* Copy the first word into a nil-terminated buffer. */ for (j = 0; j < 4; j++, i++) { --- 698,703 ---- *************** *** 719,725 **** * Begin recursive parse sequence. Since we're at the start of * the line, we don't need to do callable/parseable checks. */ ! if ( ! mdoc_macro(m, c, ln, ppos, &i, buf)) goto err; return(1); --- 730,736 ---- * Begin recursive parse sequence. Since we're at the start of * the line, we don't need to do callable/parseable checks. */ ! if ( ! mdoc_macro(m, c, ln, 1, &i, buf)) goto err; return(1);