aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--libqpdf/QUtil.cc7
-rw-r--r--qpdf/qtest/qpdf/good10.out10
-rw-r--r--qpdf/qtest/qpdf/good10.pdf2
-rw-r--r--qpdf/qtest/qpdf/good10.qdf4
5 files changed, 18 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 14a9b928..76cbef33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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