-/* $Id: man_macro.c,v 1.24 2009/08/20 13:51:55 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.26 2009/08/21 12:12:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
{
int w, la;
char *p;
+ struct man_node *n;
/* Close out prior scopes. */
if ( ! man_head_alloc(m, line, ppos, tok))
return(0);
+ n = m->last;
+
/* Add line arguments. */
for (;;) {
/* Close out head and open body (unless MAN_SCOPE). */
- if (MAN_SCOPED & man_macros[tok].flags) {
+ if (n == m->last && MAN_SCOPED & man_macros[tok].flags) {
m->flags |= MAN_BLINE;
return(1);
} else if ( ! rew_scope(MAN_HEAD, m, tok))
return(0);
}
- if (n == m->last && (MAN_SCOPED & man_macros[tok].flags)) {
+ if (n == m->last && MAN_SCOPED & man_macros[tok].flags) {
m->flags |= MAN_ELINE;
return(1);
}
continue;
if ( ! (MAN_EXPLICIT & man_macros[n->tok].flags))
continue;
- return(man_nerr(m, n, WEXITSCOPE));
+ if ( ! man_nwarn(m, n, WEXITSCOPE))
+ return(0);
}
return(man_unscope(m, m->first));