=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -p -r1.52 -r1.53 --- mandoc/roff.c 2008/12/08 16:29:57 1.52 +++ mandoc/roff.c 2008/12/08 20:32:49 1.53 @@ -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 *, @@ -680,6 +681,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,22 +815,8 @@ roffspecial(struct rofftree *tree, int tok, const char case (ROFF_At): if (0 == sz) break; - if (0 == strcmp(*ordp, "v1")) + if (roffisatt(*ordp)) 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")) - 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);