From: Explorer09 Date: Sun, 12 Nov 2017 18:11:10 +0000 (+0800) Subject: scanner: Allow "--" as option argument. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7d45afc6aeb49745f17d21ddba4848e0c0118fc;p=flex scanner: Allow "--" as option argument. Previously, invocations such as: flex --outfile -- wc1.l would fail with "requires an argument" error message. Fixes #285 --- 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;