Commit 791e0db7627e57d81076606e63786383f80219a3
1 parent
6299c64c
Allow trailing . in numeric token (fixes #165)
Showing
5 changed files
with
18 additions
and
12 deletions
ChangeLog
| 1 | 1 | 2018-01-13 Jay Berkenbilt <ejb@ql.org> |
| 2 | 2 | |
| 3 | + * Fix lexical error: the PDF specification allows floating point | |
| 4 | + numbers to end with ".". Fixes #165. | |
| 5 | + | |
| 3 | 6 | * Fix link order in the build to avoid conflicts when building |
| 4 | - from source while an older version of qpdf is installed. | |
| 7 | + from source while an older version of qpdf is installed. Fixes #158. | |
| 5 | 8 | |
| 6 | 9 | * Add support for TIFF predictor for LZW and Flate streams. Now |
| 7 | - all predictor functions are supported. | |
| 10 | + all predictor functions are supported. Fixes #171. | |
| 8 | 11 | |
| 9 | 12 | 2017-12-25 Jay Berkenbilt <ejb@ql.org> |
| 10 | 13 | ... | ... |
libqpdf/QUtil.cc
| ... | ... | @@ -558,7 +558,7 @@ QUtil::is_digit(char ch) |
| 558 | 558 | bool |
| 559 | 559 | QUtil::is_number(char const* p) |
| 560 | 560 | { |
| 561 | - // ^[\+\-]?(\.\d+|\d+(\.\d+)?)$ | |
| 561 | + // ^[\+\-]?(\.\d*|\d+(\.\d*)?)$ | |
| 562 | 562 | if (! *p) |
| 563 | 563 | { |
| 564 | 564 | return false; |
| ... | ... | @@ -578,11 +578,6 @@ QUtil::is_number(char const* p) |
| 578 | 578 | // only one dot |
| 579 | 579 | return false; |
| 580 | 580 | } |
| 581 | - if (! *(p+1)) | |
| 582 | - { | |
| 583 | - // dot can't be last | |
| 584 | - return false; | |
| 585 | - } | |
| 586 | 581 | found_dot = true; |
| 587 | 582 | } |
| 588 | 583 | else if (QUtil::is_digit(*p)) | ... | ... |
qpdf/qtest/qpdf/good10.out
| 1 | 1 | /QTest is direct and has type array (8) |
| 2 | -/QTest is an array with 3 items | |
| 2 | +/QTest is an array with 7 items | |
| 3 | 3 | item 0 is direct |
| 4 | 4 | item 1 is direct |
| 5 | 5 | item 2 is indirect |
| 6 | -unparse: [ 1 (2) 8 0 R ] | |
| 7 | -unparseResolved: [ 1 (2) 8 0 R ] | |
| 6 | + item 3 is direct | |
| 7 | + item 4 is direct | |
| 8 | + item 5 is direct | |
| 9 | + item 6 is direct | |
| 10 | +unparse: [ 1 (2) 8 0 R 0.0 -0.0 0. -0. ] | |
| 11 | +unparseResolved: [ 1 (2) 8 0 R 0.0 -0.0 0. -0. ] | |
| 8 | 12 | test 1 done | ... | ... |
qpdf/qtest/qpdf/good10.pdf