pdfbox-commits mailing list archives

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

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

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

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



Mime
View raw message