pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1821080 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Date Sat, 13 Jan 2018 17:34:09 GMT
Author: tilman
Date: Sat Jan 13 17:34:09 2018
New Revision: 1821080

URL: http://svn.apache.org/viewvc?rev=1821080&view=rev
Log:
PDFBOX-4064: ignore "-" in the middle of a number

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1821080&r1=1821079&r2=1821080&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
Sat Jan 13 17:34:09 2018
@@ -348,9 +348,13 @@ public class PDFStreamParser extends Bas
                 pdfSource.read();
 
                 boolean dotNotRead = (c != '.');
-                while( Character.isDigit(( c = (char)pdfSource.peek()) ) || (dotNotRead &&
(c == '.')) )
+                while (Character.isDigit((c = (char) pdfSource.peek())) || (dotNotRead &&
(c == '.')) || c == '-')
                 {
-                    buf.append( c );
+                    if (c != '-')
+                    {
+                        // PDFBOX-4064: ignore "-" in the middle of a number
+                        buf.append(c);
+                    }
                     pdfSource.read();
 
                     if (dotNotRead && (c == '.'))



Mime
View raw message