Commit 11314a9551b66921ad7fa4f977ca17c1f5ed3030
1 parent
22f5b01f
Don't declare any PCRE objects static.
Showing
4 changed files
with
21 additions
and
10 deletions
ChangeLog
| 1 | +2011-12-28 Jay Berkenbilt <ejb@ql.org> | ||
| 2 | + | ||
| 3 | + * Since PCRE is not necessarily thread safe, don't declare any | ||
| 4 | + PCRE objects to be static. | ||
| 5 | + | ||
| 6 | + * Disregard stderr output from ghostscript when using it to | ||
| 7 | + compare images in the test suite; see comments in qpdf.test for | ||
| 8 | + details. | ||
| 9 | + | ||
| 10 | + * Fixed a few documentation errors. | ||
| 11 | + | ||
| 1 | 2011-08-11 Jay Berkenbilt <ejb@ql.org> | 12 | 2011-08-11 Jay Berkenbilt <ejb@ql.org> |
| 2 | 13 | ||
| 3 | * 2.3.0: release | 14 | * 2.3.0: release |
libqpdf/QPDF.cc
| @@ -364,8 +364,8 @@ QPDF::getWarnings() | @@ -364,8 +364,8 @@ QPDF::getWarnings() | ||
| 364 | void | 364 | void |
| 365 | QPDF::parse(char const* password) | 365 | QPDF::parse(char const* password) |
| 366 | { | 366 | { |
| 367 | - static PCRE header_re("^%PDF-(1.\\d+)\\b"); | ||
| 368 | - static PCRE eof_re("(?s:startxref\\s+(\\d+)\\s+%%EOF\\b)"); | 367 | + PCRE header_re("^%PDF-(1.\\d+)\\b"); |
| 368 | + PCRE eof_re("(?s:startxref\\s+(\\d+)\\s+%%EOF\\b)"); | ||
| 369 | 369 | ||
| 370 | if (password) | 370 | if (password) |
| 371 | { | 371 | { |
| @@ -475,9 +475,9 @@ QPDF::setTrailer(QPDFObjectHandle obj) | @@ -475,9 +475,9 @@ QPDF::setTrailer(QPDFObjectHandle obj) | ||
| 475 | void | 475 | void |
| 476 | QPDF::reconstruct_xref(QPDFExc& e) | 476 | QPDF::reconstruct_xref(QPDFExc& e) |
| 477 | { | 477 | { |
| 478 | - static PCRE obj_re("^\\s*(\\d+)\\s+(\\d+)\\s+obj\\b"); | ||
| 479 | - static PCRE endobj_re("^\\s*endobj\\b"); | ||
| 480 | - static PCRE trailer_re("^\\s*trailer\\b"); | 478 | + PCRE obj_re("^\\s*(\\d+)\\s+(\\d+)\\s+obj\\b"); |
| 479 | + PCRE endobj_re("^\\s*endobj\\b"); | ||
| 480 | + PCRE trailer_re("^\\s*trailer\\b"); | ||
| 481 | 481 | ||
| 482 | warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, | 482 | warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, |
| 483 | "file is damaged")); | 483 | "file is damaged")); |
| @@ -615,8 +615,8 @@ QPDF::read_xref(off_t xref_offset) | @@ -615,8 +615,8 @@ QPDF::read_xref(off_t xref_offset) | ||
| 615 | int | 615 | int |
| 616 | QPDF::read_xrefTable(off_t xref_offset) | 616 | QPDF::read_xrefTable(off_t xref_offset) |
| 617 | { | 617 | { |
| 618 | - static PCRE xref_first_re("^\\s*(\\d+)\\s+(\\d+)"); | ||
| 619 | - static PCRE xref_entry_re("(?s:(^\\d{10}) (\\d{5}) ([fn])[ \r\n]{2}$)"); | 618 | + PCRE xref_first_re("^\\s*(\\d+)\\s+(\\d+)"); |
| 619 | + PCRE xref_entry_re("(?s:(^\\d{10}) (\\d{5}) ([fn])[ \r\n]{2}$)"); | ||
| 620 | 620 | ||
| 621 | std::vector<ObjGen> deleted_items; | 621 | std::vector<ObjGen> deleted_items; |
| 622 | 622 | ||
| @@ -1461,7 +1461,7 @@ int | @@ -1461,7 +1461,7 @@ int | ||
| 1461 | QPDF::recoverStreamLength(PointerHolder<InputSource> input, | 1461 | QPDF::recoverStreamLength(PointerHolder<InputSource> input, |
| 1462 | int objid, int generation, off_t stream_offset) | 1462 | int objid, int generation, off_t stream_offset) |
| 1463 | { | 1463 | { |
| 1464 | - static PCRE endobj_re("^\s*endobj\b"); | 1464 | + PCRE endobj_re("^\s*endobj\b"); |
| 1465 | 1465 | ||
| 1466 | // Try to reconstruct stream length by looking for | 1466 | // Try to reconstruct stream length by looking for |
| 1467 | // endstream(\r\n?|\n)endobj | 1467 | // endstream(\r\n?|\n)endobj |
libqpdf/QPDFTokenizer.cc
| @@ -47,7 +47,7 @@ QPDFTokenizer::reset() | @@ -47,7 +47,7 @@ QPDFTokenizer::reset() | ||
| 47 | void | 47 | void |
| 48 | QPDFTokenizer::presentCharacter(char ch) | 48 | QPDFTokenizer::presentCharacter(char ch) |
| 49 | { | 49 | { |
| 50 | - static PCRE num_re("^[\+\-]?(?:\.\d+|\d+(?:\.\d+)?)$"); | 50 | + PCRE num_re("^[\+\-]?(?:\.\d+|\d+(?:\.\d+)?)$"); |
| 51 | 51 | ||
| 52 | if (state == st_token_ready) | 52 | if (state == st_token_ready) |
| 53 | { | 53 | { |
libqpdf/QPDF_linearization.cc
| @@ -92,7 +92,7 @@ QPDF::isLinearized() | @@ -92,7 +92,7 @@ QPDF::isLinearized() | ||
| 92 | memset(buf, '\0', tbuf_size); | 92 | memset(buf, '\0', tbuf_size); |
| 93 | this->file->read(buf, tbuf_size - 1); | 93 | this->file->read(buf, tbuf_size - 1); |
| 94 | 94 | ||
| 95 | - static PCRE lindict_re("(?s:(\d+)\s+0\s+obj\s*<<)"); | 95 | + PCRE lindict_re("(?s:(\d+)\s+0\s+obj\s*<<)"); |
| 96 | 96 | ||
| 97 | int lindict_obj = -1; | 97 | int lindict_obj = -1; |
| 98 | char* p = buf; | 98 | char* p = buf; |