aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFArgParser.cc3
-rw-r--r--libqpdf/QPDFJob_argv.cc5
2 files changed, 6 insertions, 2 deletions
diff --git a/libqpdf/QPDFArgParser.cc b/libqpdf/QPDFArgParser.cc
index 0e072c10..868db709 100644
--- a/libqpdf/QPDFArgParser.cc
+++ b/libqpdf/QPDFArgParser.cc
@@ -554,8 +554,7 @@ QPDFArgParser::parseArgs()
bool have_parameter = false;
std::string o_arg(arg);
std::string arg_s(arg);
- if ((strcmp(arg, "--") == 0) &&
- (this->m->option_table != &this->m->main_option_table))
+ if (strcmp(arg, "--") == 0)
{
// Special case for -- option, which is used to break out
// of subparsers.
diff --git a/libqpdf/QPDFJob_argv.cc b/libqpdf/QPDFJob_argv.cc
index 6cbbd841..b1e3da1c 100644
--- a/libqpdf/QPDFJob_argv.cc
+++ b/libqpdf/QPDFJob_argv.cc
@@ -67,6 +67,11 @@ ArgParser::initOptionTables()
this->ap.addFinalCheck([this](){c_main->checkConfiguration();});
// add_help is defined in auto_job_help.hh
add_help(this->ap);
+ // Special case: ignore -- at the top level. This undocumented
+ // behavior is for backward compatibility; it was unintentionally
+ // the case prior to 10.6, and some users were relying on it.
+ this->ap.selectMainOptionTable();
+ this->ap.addBare("--", [](){});
}
void