From: Kristaps Dzonsons Date: Mon, 8 Dec 2008 20:32:49 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: VERSION_1_0_2~9 X-Git-Url: https://git.cameronkatri.com/mandoc.git/commitdiff_plain/cd19011dce5589ac8d73a0ca343acfeb33f05235 *** empty log message *** --- diff --git a/roff.c b/roff.c index 052267b9..d13e07eb 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.52 2008/12/08 16:29:57 kristaps Exp $ */ +/* $Id: roff.c,v 1.53 2008/12/08 20:32:49 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -84,6 +84,7 @@ static int rofffindcallable(const char *); static int roffismsec(const char *); static int roffissec(const char **); static int roffispunct(const char *); +static int roffisatt(const char *); static int roffchecksec(struct rofftree *, const char *, int); static int roffargs(const struct rofftree *, @@ -679,6 +680,32 @@ roffismsec(const char *p) } +static int +roffisatt(const char *p) +{ + + assert(p); + if (0 == strcmp(p, "v1")) + return(1); + else if (0 == strcmp(p, "v2")) + return(1); + else if (0 == strcmp(p, "v3")) + return(1); + else if (0 == strcmp(p, "v6")) + return(1); + else if (0 == strcmp(p, "v7")) + return(1); + else if (0 == strcmp(p, "32v")) + return(1); + else if (0 == strcmp(p, "V.1")) + return(1); + else if (0 == strcmp(p, "V.4")) + return(1); + + return(0); +} + + static int roffispunct(const char *p) { @@ -788,21 +815,7 @@ roffspecial(struct rofftree *tree, int tok, const char *start, case (ROFF_At): if (0 == sz) break; - if (0 == strcmp(*ordp, "v1")) - break; - else if (0 == strcmp(*ordp, "v2")) - break; - else if (0 == strcmp(*ordp, "v3")) - break; - else if (0 == strcmp(*ordp, "v6")) - break; - else if (0 == strcmp(*ordp, "v7")) - break; - else if (0 == strcmp(*ordp, "32v")) - break; - else if (0 == strcmp(*ordp, "V.1")) - break; - else if (0 == strcmp(*ordp, "V.4")) + if (roffisatt(*ordp)) break; roff_err(tree, *ordp, "invalid `At' arg"); return(0); @@ -1291,7 +1304,7 @@ static int roff_layout(ROFFCALL_ARGS) { int i, c, argcp[ROFF_MAXLINEARG]; - char *argvp[ROFF_MAXLINEARG]; + char *argvp[ROFF_MAXLINEARG], *p; /* * The roff_layout function is for multi-line macros. A layout @@ -1320,7 +1333,7 @@ roff_layout(ROFFCALL_ARGS) assert( ! (ROFF_CALLABLE & tokens[tok].flags)); - ++argv; + p = *argv++; if ( ! roffparseopts(tree, tok, &argv, argcp, argvp)) return(0);