version 1.163, 2010/08/20 01:02:07 |
version 1.169, 2010/12/15 23:39:40 |
Line 286 mdoc_macro(MACRO_PROT_ARGS) |
|
Line 286 mdoc_macro(MACRO_PROT_ARGS) |
|
! (MDOC_PBODY & m->flags)) { |
! (MDOC_PBODY & m->flags)) { |
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG)) |
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG)) |
return(0); |
return(0); |
|
if (NULL == m->meta.msec) |
|
m->meta.msec = mandoc_strdup("1"); |
if (NULL == m->meta.title) |
if (NULL == m->meta.title) |
m->meta.title = mandoc_strdup("UNKNOWN"); |
m->meta.title = mandoc_strdup("UNKNOWN"); |
if (NULL == m->meta.vol) |
if (NULL == m->meta.vol) |
Line 328 node_append(struct mdoc *mdoc, struct mdoc_node *p) |
|
Line 330 node_append(struct mdoc *mdoc, struct mdoc_node *p) |
|
|
|
if ( ! mdoc_valid_pre(mdoc, p)) |
if ( ! mdoc_valid_pre(mdoc, p)) |
return(0); |
return(0); |
if ( ! mdoc_action_pre(mdoc, p)) |
|
return(0); |
|
|
|
switch (p->type) { |
switch (p->type) { |
case (MDOC_HEAD): |
case (MDOC_HEAD): |
Line 356 node_append(struct mdoc *mdoc, struct mdoc_node *p) |
|
Line 356 node_append(struct mdoc *mdoc, struct mdoc_node *p) |
|
case (MDOC_TEXT): |
case (MDOC_TEXT): |
if ( ! mdoc_valid_post(mdoc)) |
if ( ! mdoc_valid_post(mdoc)) |
return(0); |
return(0); |
if ( ! mdoc_action_post(mdoc)) |
|
return(0); |
|
break; |
break; |
default: |
default: |
break; |
break; |
Line 554 mdoc_node_unlink(struct mdoc *m, struct mdoc_node *n) |
|
Line 552 mdoc_node_unlink(struct mdoc *m, struct mdoc_node *n) |
|
n->parent->nchild--; |
n->parent->nchild--; |
if (n->parent->child == n) |
if (n->parent->child == n) |
n->parent->child = n->prev ? n->prev : n->next; |
n->parent->child = n->prev ? n->prev : n->next; |
|
if (n->parent->last == n) |
|
n->parent->last = n->prev ? n->prev : NULL; |
} |
} |
|
|
/* Adjust parse point, if applicable. */ |
/* Adjust parse point, if applicable. */ |
Line 691 mdoc_ptext(struct mdoc *m, int line, char *buf, int of |
|
Line 691 mdoc_ptext(struct mdoc *m, int line, char *buf, int of |
|
return(0); |
return(0); |
|
|
/* |
/* |
* Insert a `Pp' in the case of a blank line. Technically, |
* Insert a `sp' in the case of a blank line. Technically, |
* blank lines aren't allowed, but enough manuals assume this |
* blank lines aren't allowed, but enough manuals assume this |
* behaviour that we want to work around it. |
* behaviour that we want to work around it. |
*/ |
*/ |
if ( ! mdoc_elem_alloc(m, line, offs, MDOC_Pp, NULL)) |
if ( ! mdoc_elem_alloc(m, line, offs, MDOC_sp, NULL)) |
return(0); |
return(0); |
|
|
m->next = MDOC_NEXT_SIBLING; |
m->next = MDOC_NEXT_SIBLING; |
Line 768 mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off |
|
Line 768 mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off |
|
|
|
tok = (j > 1 || j < 4) ? mdoc_hash_find(mac) : MDOC_MAX; |
tok = (j > 1 || j < 4) ? mdoc_hash_find(mac) : MDOC_MAX; |
if (MDOC_MAX == tok) { |
if (MDOC_MAX == tok) { |
mdoc_vmsg(m, MANDOCERR_MACRO, ln, sv, |
mdoc_vmsg(m, MANDOCERR_MACRO, ln, sv, "%s", buf + sv - 1); |
"unknown macro: %s%s", |
|
buf, strlen(buf) > 3 ? "..." : ""); |
|
return(1); |
return(1); |
} |
} |
|
|