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 | 6aaaf55fc07e369105283ad90562fb1bd4c2d1ee (patch) | |
tree | 65ec300c3f1b6755d1e87999432acd01fccda5b1 /roff.c | |
parent | 2cf6c3e0cc5c2b88c77c74a4b882f175a4ade7d1 (diff) | |
download | mandoc-6aaaf55fc07e369105283ad90562fb1bd4c2d1ee.tar.gz |
*** empty log message ***
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 47 |
1 files changed, 30 insertions, 17 deletions
@@ -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); |