Subject: | _startdoc finds FIRST occurence of startxref in last 1024 bytes, though it should look for LAST |
I think title of this report is self-explanatory.
Suppose we have an incrementally saved PDF file. Changes, before last
save, were very small -- so appended new objects, xref section and
trailer all fit in 1024 bytes.
That means, that now last 1024 bytes of a file contain TWO instances of
word 'startxref'. The very beginning of procedure _startdoc finds first
match, and therefore old version of a file is read.
All this is easily fixed, if we add greedy .* to beginning of a pattern.
Then last 'startxref' will be found, as expected.
Best regards