From dd0ddef53782100e39cb4e55f8ca5e70b8e8c5c2 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 29 Jul 2015 12:32:20 +0100 Subject: [PATCH] Output error message when passed multiple arguments after "--" option. All arguments after "--" are treated as input files, but re2c expects exactly one input file. --- re2c/bootstrap/src/conf/parse_opts.cc | 6 +++--- re2c/src/conf/parse_opts.re | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 4d8352ce..26ed9fb8 100644 --- a/re2c/bootstrap/src/conf/parse_opts.cc +++ b/re2c/bootstrap/src/conf/parse_opts.cc @@ -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 #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; } diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index df7e49f8..b3bddb61 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -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; } -- 2.40.0