]> granicus.if.org Git - re2c/commitdiff
Output error message when passed multiple arguments after "--" option.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 29 Jul 2015 11:32:20 +0000 (12:32 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 29 Jul 2015 11:32:20 +0000 (12:32 +0100)
All arguments after "--" are treated as input files, but re2c expects
exactly one input file.

re2c/bootstrap/src/conf/parse_opts.cc
re2c/src/conf/parse_opts.re

index 4d8352cebcc8ad11bfa9bb0e1715bc4a42717ec7..26ed9fb84dfa68b63076b15f81ad8fdb2aa5519c 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.14.3 on Mon Jul 27 12:54:38 2015 */
+/* Generated by re2c 0.14.3 on Wed Jul 29 12:29:18 2015 */
 #include <stdio.h>
 
 #include "src/conf/msg.h"
@@ -115,9 +115,9 @@ yy13:
                // all remaining arguments are non-options
                // so they must be input files
                // re2c expects exactly one input file
-               if (const char * f = *++argv)
+               for (const char * f = *++argv; f; f = *++argv)
                {
-                       if (!opts.source (f) || *++argv)
+                       if (!opts.source (f))
                        {
                                return EXIT_FAIL;
                        }
index df7e49f8856bf6caf42d7f883654358bb78981d8..b3bddb611cdab408b81a996e800175c7b8f3b4ca 100644 (file)
@@ -44,9 +44,9 @@ opt:
                // all remaining arguments are non-options
                // so they must be input files
                // re2c expects exactly one input file
-               if (const char * f = *++argv)
+               for (const char * f = *++argv; f; f = *++argv)
                {
-                       if (!opts.source (f) || *++argv)
+                       if (!opts.source (f))
                        {
                                return EXIT_FAIL;
                        }