aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFJob.cc4
-rw-r--r--libqpdf/QPDFJob_config.cc5
2 files changed, 4 insertions, 5 deletions
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc
index 2e0abb43..3bdb4f39 100644
--- a/libqpdf/QPDFJob.cc
+++ b/libqpdf/QPDFJob.cc
@@ -2446,6 +2446,10 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea
auto n_collate = m->collate.size();
auto n_specs = parsed_specs.size();
+ if (!(n_collate == 0 || n_collate == 1 || n_collate == n_specs)) {
+ usage("--pages: if --collate has more than one value, it must have one value per page "
+ "specification");
+ }
if (n_collate > 0 && n_specs > 1) {
// Collate the pages by selecting one page from each spec in order. When a spec runs out of
// pages, stop selecting from it.
diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc
index e48d7e31..db6c5948 100644
--- a/libqpdf/QPDFJob_config.cc
+++ b/libqpdf/QPDFJob_config.cc
@@ -957,11 +957,6 @@ QPDFJob::PagesConfig::endPages()
if (n_specs == 0) {
usage("--pages: no page specifications given");
}
- auto n_collate = config->o.m->collate.size();
- if (!(n_collate == 0 || n_collate == 1 || n_collate == n_specs)) {
- usage("--pages: if --collate has more than one value, it must have one value per page "
- "specification");
- }
return this->config;
}