Fix bug preventing startXref to be found for files with a single byte EOL encoding

This commit is contained in:
Tissevert 2019-05-13 11:34:15 +02:00
parent c036334b6f
commit 6eacb55fc4

View file

@ -182,7 +182,7 @@ readStartXref eolStyle input =
BS.length input - BS.length eofMarker BS.length input - BS.length eofMarker
- if BS.last input == BS.last eofMarker then 0 else eolOffset - if BS.last input == BS.last eofMarker then 0 else eolOffset
startXrefPosition = startXrefPosition =
previous eolLastByte (eofMarkerPosition - eolOffset) input + 1 previous eolLastByte (eofMarkerPosition - eolOffset - 1) input + 1
startXrefLength = eofMarkerPosition - eolOffset - startXrefPosition startXrefLength = eofMarkerPosition - eolOffset - startXrefPosition
parseDocument :: ByteString -> Either ParseError Document parseDocument :: ByteString -> Either ParseError Document