Commit fa3cdaf1b46dcbb583393f93a02f89207ba21a88
1 parent
dedf9a06
Check for warnings in files used by --pages
Showing
4 changed files
with
13 additions
and
1 deletions
ChangeLog
| 1 | +2023-09-03 Jay Berkenbilt <ejb@ql.org> | |
| 2 | + | |
| 3 | + * Bug fix: with --pages, if one of the external files had warnings | |
| 4 | + but the main file did not, the warning was previously not taken | |
| 5 | + into consideration when determining the exit status. | |
| 6 | + | |
| 1 | 7 | 2023-09-02 Jay Berkenbilt <ejb@ql.org> |
| 2 | 8 | |
| 3 | 9 | * Bug fix from M. Holger: allow fix-qdf to read from pipe. Fixes #1010. | ... | ... |
libqpdf/QPDFJob.cc
| ... | ... | @@ -2561,6 +2561,11 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea |
| 2561 | 2561 | } |
| 2562 | 2562 | } |
| 2563 | 2563 | } |
| 2564 | + for (auto const& p: page_spec_qpdfs) { | |
| 2565 | + if (!p.second->getWarnings().empty()) { | |
| 2566 | + m->warnings = true; | |
| 2567 | + } | |
| 2568 | + } | |
| 2564 | 2569 | } |
| 2565 | 2570 | |
| 2566 | 2571 | void | ... | ... |
qpdf/qtest/page-errors.test
| ... | ... | @@ -22,7 +22,7 @@ $td->runtest("handle page no with contents", |
| 22 | 22 | $td->NORMALIZE_NEWLINES); |
| 23 | 23 | $td->runtest("handle page with missing MediaBox", |
| 24 | 24 | {$td->COMMAND => "qpdf --static-id --empty --pages page-no-content.pdf -- out.pdf"}, |
| 25 | - {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 0}, | |
| 25 | + {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 3}, | |
| 26 | 26 | $td->NORMALIZE_NEWLINES); |
| 27 | 27 | $td->runtest("check output", |
| 28 | 28 | {$td->FILE => "out.pdf"}, | ... | ... |
qpdf/qtest/qpdf/page-missing-mediabox.out