Pdf "convert" primitives bug
Hi, While working on luatex's \directlua, I ran into a rather interesting bug that affects a number of pdftex primitives as well. Because these do not all have the same author and the needed fix is not identical for all, I thought it easier to write an email message than to try to create a patch myself. The problem: When tex calls `conv_toks()' to execute `convert' commands, a string may already be being built. A call to scan_toks (pdf_scan_ext_toks) at that moment will incorporate that partial string to the argument of the `convert' primitive, and erase it from the output. Example code: \message{\pdfmdfivesum{knuth}} \input knuth\pdfmdfivesum{} \bye Affected primitives: \pdfescapestring \pdfescapename \pdfescapehex \pdfunescapehex \pdffilemoddate \pdffilesize \pdffiledump \pdfmdfivesum \pdfstrcmp The needed fix: Somewhen before calling scan_pdf_ext_toks, you have to store the partial string as a true tex string, then its `partialness' has to be restored sometime later before leaving conv_toks(). Greetings, Taco
Taco Hoekwater wrote:
The problem:
When tex calls `conv_toks()' to execute `convert' commands, a string may already be being built. A call to scan_toks (pdf_scan_ext_toks) at that moment will incorporate that partial string to the argument of the `convert' primitive, and erase it from the output.
That should read 'input' instead of 'output' of course. Taco
On Wed, Sep 27, 2006 at 04:16:13PM +0200, Taco Hoekwater wrote:
While working on luatex's \directlua, I ran into a rather interesting bug that affects a number of pdftex primitives as well. Because these do not all have the same author and the needed fix is not identical for all, I thought it easier to write an email message than to try to create a patch myself.
Thanks for detecting the bug and the bug analysis.
I had provided some of the affected primitives. However,
basically I had only copied the method from \pdfstrcmp.
Please, fix all the primitives.
Yours sincerely
Heiko
2006/9/27, Heiko Oberdiek
While working on luatex's \directlua, I ran into a rather interesting bug that affects a number of pdftex primitives as well. Because these do not all have the same author and the needed fix is not identical for all, I thought it easier to write an email message than to try to create a patch myself.
Thanks for detecting the bug and the bug analysis.
Same here. Please file this as a bug at sarovar so we don't forget it. But Taco, you are the web-programming-expert here, so you are the best candidate for fixing it. :-) Best Martin
Martin Schröder wrote:
2006/9/27, Heiko Oberdiek
: While working on luatex's \directlua, I ran into a rather interesting bug that affects a number of pdftex primitives as well. Because these do not all have the same author and the needed fix is not identical for all, I thought it easier to write an email message than to try to create a patch myself.
Thanks for detecting the bug and the bug analysis.
Same here.
Please file this as a bug at sarovar so we don't forget it. But Taco, you are the web-programming-expert here, so you are the best candidate for fixing it. :-)
Sometime next week, then. Greetings, Taco
participants (3)
-
Heiko Oberdiek
-
Martin Schröder
-
Taco Hoekwater