version 1.92, 2014/12/16 17:26:00 |
version 1.93, 2015/01/24 01:58:33 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de> |
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
Line 279 blk_close(MACRO_PROT_ARGS) |
|
Line 279 blk_close(MACRO_PROT_ARGS) |
|
{ |
{ |
enum mant ntok; |
enum mant ntok; |
const struct man_node *nn; |
const struct man_node *nn; |
|
char *p; |
|
int nrew, target; |
|
|
|
nrew = 1; |
switch (tok) { |
switch (tok) { |
case MAN_RE: |
case MAN_RE: |
ntok = MAN_RS; |
ntok = MAN_RS; |
|
if ( ! man_args(man, line, pos, buf, &p)) |
|
break; |
|
for (nn = man->last->parent; nn; nn = nn->parent) |
|
if (nn->tok == ntok && nn->type == MAN_BLOCK) |
|
nrew++; |
|
target = strtol(p, &p, 10); |
|
if (*p != '\0') |
|
mandoc_vmsg(MANDOCERR_ARG_EXCESS, man->parse, |
|
line, p - buf, "RE ... %s", p); |
|
if (target == 0) |
|
target = 1; |
|
nrew -= target; |
|
if (nrew < 1) { |
|
mandoc_vmsg(MANDOCERR_RE_NOTOPEN, man->parse, |
|
line, ppos, "RE %d", target); |
|
return; |
|
} |
break; |
break; |
case MAN_UE: |
case MAN_UE: |
ntok = MAN_UR; |
ntok = MAN_UR; |
Line 293 blk_close(MACRO_PROT_ARGS) |
|
Line 313 blk_close(MACRO_PROT_ARGS) |
|
} |
} |
|
|
for (nn = man->last->parent; nn; nn = nn->parent) |
for (nn = man->last->parent; nn; nn = nn->parent) |
if (nn->tok == ntok && nn->type == MAN_BLOCK) |
if (nn->tok == ntok && nn->type == MAN_BLOCK && ! --nrew) |
break; |
break; |
|
|
if (nn == NULL) { |
if (nn == NULL) { |