diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-06-18 16:53:27 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-06-18 16:53:27 +0000 |
commit | 62c13020786d9253993bfb33adb6d6499e650572 (patch) | |
tree | c8c799cf9f7b0d792ec214c7216960649fc19a1f /mdoc_argv.c | |
parent | 209507675e82bf5c7bdae520414d5ead8d59ec1c (diff) | |
download | mandoc-62c13020786d9253993bfb33adb6d6499e650572.tar.gz |
Add back in a check that the leading `-' exists for arguments. This
mysteriously disappeared in 1.14. No idea why. While here, remove an
unnecessary header and order the function prototypes.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r-- | mdoc_argv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c index 6fa4c84f..0aef6ee7 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -21,7 +21,6 @@ #include <sys/types.h> #include <assert.h> -#include <ctype.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -52,16 +51,16 @@ struct mdocarg { const enum mdocargt *argvs; }; +static void argn_free(struct mdoc_arg *, int); static enum margserr args(struct mdoc *, int, int *, char *, enum argsflag, char **); static int args_checkpunct(const char *, int); -static int argv_single(struct mdoc *, int, +static int argv_multi(struct mdoc *, int, struct mdoc_argv *, int *, char *); static int argv_opt_single(struct mdoc *, int, struct mdoc_argv *, int *, char *); -static int argv_multi(struct mdoc *, int, +static int argv_single(struct mdoc *, int, struct mdoc_argv *, int *, char *); -static void argn_free(struct mdoc_arg *, int); static const enum argvflag argvflags[MDOC_ARG_MAX] = { ARGV_NONE, /* MDOC_Split */ @@ -290,8 +289,8 @@ mdoc_argv(struct mdoc *m, int line, enum mdoct tok, return(ARGV_EOLN); else if (NULL == (ap = mdocargs[tok].argvs)) return(ARGV_WORD); - - assert(' ' != buf[*pos]); + else if ('-' != buf[*pos]) + return(ARGV_WORD); /* Seek to the first unescaped space. */ |