Commit 90217e6686fe2f3790f2a36d1ab74bab13a0aab5

Authored by Jay Berkenbilt
1 parent c60af08a

Fix another case of errors written to stdout (fixes #438)

@@ -2,7 +2,6 @@ Candidates for upcoming release @@ -2,7 +2,6 @@ Candidates for upcoming release
2 =============================== 2 ===============================
3 3
4 * Quick issues: 4 * Quick issues:
5 - * #438: things written to stdout instead of stderr; --no-warn issues  
6 * Add --warning-exit-0 option. Search for --no-warn in the docs. 5 * Add --warning-exit-0 option. Search for --no-warn in the docs.
7 6
8 * Easy build/test 7 * Easy build/test
qpdf/qpdf.cc
@@ -3513,14 +3513,14 @@ static void do_check(QPDF& pdf, Options& o, int& exit_code) @@ -3513,14 +3513,14 @@ static void do_check(QPDF& pdf, Options& o, int& exit_code)
3513 catch (QPDFExc& e) 3513 catch (QPDFExc& e)
3514 { 3514 {
3515 okay = false; 3515 okay = false;
3516 - std::cout << "page " << pageno << ": " 3516 + std::cerr << "ERROR: page " << pageno << ": "
3517 << e.what() << std::endl; 3517 << e.what() << std::endl;
3518 } 3518 }
3519 } 3519 }
3520 } 3520 }
3521 catch (std::exception& e) 3521 catch (std::exception& e)
3522 { 3522 {
3523 - std::cout << e.what() << std::endl; 3523 + std::cerr << "ERROR: " << e.what() << std::endl;
3524 okay = false; 3524 okay = false;
3525 } 3525 }
3526 if (okay) 3526 if (okay)
qpdf/qtest/qpdf/linearization-large-vector-alloc.out
@@ -5,4 +5,4 @@ File is linearized @@ -5,4 +5,4 @@ File is linearized
5 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1282): expected endstream 5 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1282): expected endstream
6 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1183): attempting to recover stream length 6 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1183): attempting to recover stream length
7 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1183): recovered stream length: 106 7 WARNING: linearization-large-vector-alloc.pdf (linearization hint stream: object 62 0, offset 1183): recovered stream length: 106
8 -overflow reading bit stream 8 +ERROR: overflow reading bit stream
qpdf/qtest/qpdf/pages-loop.out
@@ -2,4 +2,4 @@ checking pages-loop.pdf @@ -2,4 +2,4 @@ checking pages-loop.pdf
2 PDF Version: 1.3 2 PDF Version: 1.3
3 File is not encrypted 3 File is not encrypted
4 File is not linearized 4 File is not linearized
5 -pages-loop.pdf (object 3 0): Loop detected in /Pages structure (getAllPages) 5 +ERROR: pages-loop.pdf (object 3 0): Loop detected in /Pages structure (getAllPages)
qpdf/qtest/qpdf/split-content-stream-errors.out
@@ -6,4 +6,4 @@ WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream dat @@ -6,4 +6,4 @@ WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream dat
6 WARNING: split-content-stream-errors.pdf (offset 557): stream will be re-processed without filtering to avoid data loss 6 WARNING: split-content-stream-errors.pdf (offset 557): stream will be re-processed without filtering to avoid data loss
7 WARNING: page object 3 0 (item index 0 (from 0)): ignoring non-stream in an array of streams 7 WARNING: page object 3 0 (item index 0 (from 0)): ignoring non-stream in an array of streams
8 WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream data for object 6 0: LZWDecoder: bad code received 8 WARNING: split-content-stream-errors.pdf (offset 557): error decoding stream data for object 6 0: LZWDecoder: bad code received
9 -page 1: content stream (content stream object 6 0): errors while decoding content stream 9 +ERROR: page 1: content stream (content stream object 6 0): errors while decoding content stream