Commit 26514ab7315ad3ecf29f113fa777326d13646a66
1 parent
22a167a0
Write linearization errors to stderr (fixes #438)
Showing
2 changed files
with
10 additions
and
5 deletions
ChangeLog
| 1 | +2020-04-29 Jay Berkenbilt <ejb@ql.org> | ||
| 2 | + | ||
| 3 | + * Bug fix: qpdf --check was writing errors and warnings reported | ||
| 4 | + by checkLinearization to stdout instead of stderr. Fixes #438. | ||
| 5 | + | ||
| 1 | 2020-04-09 Jay Berkenbilt <ejb@ql.org> | 6 | 2020-04-09 Jay Berkenbilt <ejb@ql.org> |
| 2 | 7 | ||
| 3 | * 10.0.1: release | 8 | * 10.0.1: release |
libqpdf/QPDF_linearization.cc
| @@ -73,7 +73,7 @@ QPDF::checkLinearization() | @@ -73,7 +73,7 @@ QPDF::checkLinearization() | ||
| 73 | } | 73 | } |
| 74 | catch (QPDFExc& e) | 74 | catch (QPDFExc& e) |
| 75 | { | 75 | { |
| 76 | - *this->m->out_stream << e.what() << std::endl; | 76 | + *this->m->err_stream << e.what() << std::endl; |
| 77 | } | 77 | } |
| 78 | return result; | 78 | return result; |
| 79 | } | 79 | } |
| @@ -386,7 +386,7 @@ QPDF::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) | @@ -386,7 +386,7 @@ QPDF::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) | ||
| 386 | if ((computed_end < min_end_offset) || | 386 | if ((computed_end < min_end_offset) || |
| 387 | (computed_end > max_end_offset)) | 387 | (computed_end > max_end_offset)) |
| 388 | { | 388 | { |
| 389 | - *this->m->out_stream << "expected = " << computed_end | 389 | + *this->m->err_stream << "expected = " << computed_end |
| 390 | << "; actual = " << min_end_offset << ".." | 390 | << "; actual = " << min_end_offset << ".." |
| 391 | << max_end_offset << std::endl; | 391 | << max_end_offset << std::endl; |
| 392 | throw QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(), | 392 | throw QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(), |
| @@ -661,7 +661,7 @@ QPDF::checkLinearizationInternal() | @@ -661,7 +661,7 @@ QPDF::checkLinearizationInternal() | ||
| 661 | for (std::list<std::string>::iterator iter = errors.begin(); | 661 | for (std::list<std::string>::iterator iter = errors.begin(); |
| 662 | iter != errors.end(); ++iter) | 662 | iter != errors.end(); ++iter) |
| 663 | { | 663 | { |
| 664 | - *this->m->out_stream << "WARNING: " << (*iter) << std::endl; | 664 | + *this->m->err_stream << "WARNING: " << (*iter) << std::endl; |
| 665 | } | 665 | } |
| 666 | } | 666 | } |
| 667 | 667 | ||
| @@ -671,7 +671,7 @@ QPDF::checkLinearizationInternal() | @@ -671,7 +671,7 @@ QPDF::checkLinearizationInternal() | ||
| 671 | for (std::list<std::string>::iterator iter = warnings.begin(); | 671 | for (std::list<std::string>::iterator iter = warnings.begin(); |
| 672 | iter != warnings.end(); ++iter) | 672 | iter != warnings.end(); ++iter) |
| 673 | { | 673 | { |
| 674 | - *this->m->out_stream << "WARNING: " << (*iter) << std::endl; | 674 | + *this->m->err_stream << "WARNING: " << (*iter) << std::endl; |
| 675 | } | 675 | } |
| 676 | } | 676 | } |
| 677 | 677 | ||
| @@ -1094,7 +1094,7 @@ QPDF::showLinearizationData() | @@ -1094,7 +1094,7 @@ QPDF::showLinearizationData() | ||
| 1094 | } | 1094 | } |
| 1095 | catch (QPDFExc& e) | 1095 | catch (QPDFExc& e) |
| 1096 | { | 1096 | { |
| 1097 | - *this->m->out_stream << e.what() << std::endl; | 1097 | + *this->m->err_stream << e.what() << std::endl; |
| 1098 | } | 1098 | } |
| 1099 | } | 1099 | } |
| 1100 | 1100 |