diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-08 20:32:49 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-08 20:32:49 +0000 |
commit | cd19011dce5589ac8d73a0ca343acfeb33f05235 (patch) | |
tree | 2268d43755785c0ac4d0dbcb63f15ae0d2c0c2f8 | |
parent | 4cfe3bb512af4b91885cb7ab426ab406a4882ebb (diff) | |
download | mandoc-cd19011dce5589ac8d73a0ca343acfeb33f05235.tar.gz mandoc-cd19011dce5589ac8d73a0ca343acfeb33f05235.tar.zst mandoc-cd19011dce5589ac8d73a0ca343acfeb33f05235.zip |
*** empty log message ***
-rw-r--r-- | roff.c | 49 |
1 files changed, 31 insertions, 18 deletions
@@ -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 <kristaps@kth.se> * @@ -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,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); |