]> granicus.if.org Git - flex/commitdiff
scanner: Allow "--" as option argument.
authorExplorer09 <explorer09@gmail.com>
Sun, 12 Nov 2017 18:11:10 +0000 (02:11 +0800)
committerWill Estes <westes575@gmail.com>
Sat, 9 Dec 2017 21:29:52 +0000 (16:29 -0500)
Previously, invocations such as:

    flex --outfile -- wc1.l

 would fail with "requires an
argument" error message.

Fixes #285

src/scanopt.c

index 04fbdc398c50c4f67aca2ed738ff7bedee2d16e0..7a91178b3a14c0afc00f300ab3859deae00e5770 100644 (file)
@@ -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;