diff options
author | Explorer09 <explorer09@gmail.com> | 2017-11-13 02:11:10 +0800 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2017-12-09 16:29:52 -0500 |
commit | e7d45afc6aeb49745f17d21ddba4848e0c0118fc (patch) | |
tree | e301f7337d45315d14eb7c3ddc001f19b992f9e1 | |
parent | c984ab0fd0ad534a725019a7bf4f49a3571d87d1 (diff) |
scanner: Allow "--" as option argument.
Previously, invocations such as:
flex --outfile -- wc1.l
would fail with "requires an
argument" error message.
Fixes #285
-rw-r--r-- | src/scanopt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/scanopt.c b/src/scanopt.c index 04fbdc3..7a91178 100644 --- a/src/scanopt.c +++ b/src/scanopt.c @@ -708,8 +708,7 @@ int scanopt (scanopt_t *svoid, char **arg, int *optindex) /* Look ahead in argv[] to see if there is something * that we can use as an argument (if needed). */ - has_next = s->index + 1 < s->argc - && strcmp ("--", s->argv[s->index + 1]) != 0; + has_next = s->index + 1 < s->argc; optp = s->options + opt_offset; auxp = s->aux + opt_offset; |