diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-01-14 02:05:13 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-01-14 02:05:40 +0100 |
commit | 791e0db7627e57d81076606e63786383f80219a3 (patch) | |
tree | 09bfe62525ca2ecfec25d37de1ca5707be08816d | |
parent | 6299c64cf3351fb1935319378aed421e26ed2f90 (diff) | |
download | qpdf-791e0db7627e57d81076606e63786383f80219a3.tar.zst |
Allow trailing . in numeric token (fixes #165)
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libqpdf/QUtil.cc | 7 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/good10.out | 10 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/good10.pdf | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/good10.qdf | 4 |
5 files changed, 18 insertions, 12 deletions
@@ -1,10 +1,13 @@ 2018-01-13 Jay Berkenbilt <ejb@ql.org> + * Fix lexical error: the PDF specification allows floating point + numbers to end with ".". Fixes #165. + * Fix link order in the build to avoid conflicts when building - from source while an older version of qpdf is installed. + from source while an older version of qpdf is installed. Fixes #158. * Add support for TIFF predictor for LZW and Flate streams. Now - all predictor functions are supported. + all predictor functions are supported. Fixes #171. 2017-12-25 Jay Berkenbilt <ejb@ql.org> diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 32855bbf..93374568 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -558,7 +558,7 @@ QUtil::is_digit(char ch) bool QUtil::is_number(char const* p) { - // ^[\+\-]?(\.\d+|\d+(\.\d+)?)$ + // ^[\+\-]?(\.\d*|\d+(\.\d*)?)$ if (! *p) { return false; @@ -578,11 +578,6 @@ QUtil::is_number(char const* p) // only one dot return false; } - if (! *(p+1)) - { - // dot can't be last - return false; - } found_dot = true; } else if (QUtil::is_digit(*p)) diff --git a/qpdf/qtest/qpdf/good10.out b/qpdf/qtest/qpdf/good10.out index 0ae08058..6f76c52f 100644 --- a/qpdf/qtest/qpdf/good10.out +++ b/qpdf/qtest/qpdf/good10.out @@ -1,8 +1,12 @@ /QTest is direct and has type array (8) -/QTest is an array with 3 items +/QTest is an array with 7 items item 0 is direct item 1 is direct item 2 is indirect -unparse: [ 1 (2) 8 0 R ] -unparseResolved: [ 1 (2) 8 0 R ] + item 3 is direct + item 4 is direct + item 5 is direct + item 6 is direct +unparse: [ 1 (2) 8 0 R 0.0 -0.0 0. -0. ] +unparseResolved: [ 1 (2) 8 0 R 0.0 -0.0 0. -0. ] test 1 done diff --git a/qpdf/qtest/qpdf/good10.pdf b/qpdf/qtest/qpdf/good10.pdf index 13a88101..a6eb85d1 100644 --- a/qpdf/qtest/qpdf/good10.pdf +++ b/qpdf/qtest/qpdf/good10.pdf @@ -73,7 +73,7 @@ xref trailer << /Size 7 /Root 1 0 R - /QTest [1 (2) 8 0 R] + /QTest [1 (2) 8 0 R 0.0 -0.0 0. -0.] >> startxref 556 diff --git a/qpdf/qtest/qpdf/good10.qdf b/qpdf/qtest/qpdf/good10.qdf index 0835c516..957168c8 100644 --- a/qpdf/qtest/qpdf/good10.qdf +++ b/qpdf/qtest/qpdf/good10.qdf @@ -96,6 +96,10 @@ trailer << 1 (2) null + 0.0 + -0.0 + 0. + -0. ] /Root 1 0 R /Size 8 |