[NTG-pdftex] [ pdftex-Patches-368 ] make \pdfstrcmp expandable (experimental patch)

noreply at sarovar.org noreply at sarovar.org
Mon Jun 20 22:09:30 CEST 2005

Patches item #368, was opened at 2005-06-18 00:29
You can respond by visiting: 

Category: Primitives
Group: v1.30.0
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Hartmut Henkel (hhenkel)
Assigned to: Nobody (None)
Summary: make \pdfstrcmp expandable (experimental patch)

Initial Comment:
just moved \pdfstrcmp over to procedure conv_toks, so
that the result -1/0/1 is inserted into the input token
list. Does this make sense?


>Comment By: Hartmut Henkel (hhenkel)
Date: 2005-06-20 22:09

Logged In: YES 

Patch 368 can be closed as an improved version is now
included in patch 371 by Heiko. Many thanks to him and Taco
for debugging!

Regards, Hartmut


Comment By: Heiko Oberdiek (oberdiek)
Date: 2005-06-20 17:02

Logged In: YES 


Taco I agree with your analysis, last weekend
I found the same variables that need saving, too.

Also I have a patch that also make \pdfescape*
expandable. Thus \pdflastescaped* are not needed
 And I could remove the dependency
on a limited buffer by copying the destination
strings directly in the string pool above the
source string.

Third I added \pdfescapehex and \pdfunescapehex
that adds encoding/decoding for hexadecimal strings:
* Strings can also be given as hex strings in
  angle brackets.
* Safe method to store and read string data to
  auxiliary files without worrying about catcodes,
  unmachted curly braces, ...
* Help in handling UTF-8/Unicode or other hex coding

I hope, I can attach the patch here in this thread
(upload part is missing?. Otherwise I will make an
new patch.

Patch is applied by
  patch <EscapeDivers.patch
in directory

The Makefile must be modified. After the lines
the line
is inserted. This is done two times for pdftex
and pdfetex.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


Comment By: Taco Hoekwater (taco)
Date: 2005-06-20 16:33

Logged In: YES 

It makes sense, but it is not 100% safe as-is. In an
expanding context, lots of stuff can go one at the same
time. Esp., scan_toks touches some global variables, so
compare_strings should save the globals def_ref,
scanner_status and warning _index to prevent stack
corruption later on.

For instance, this crashes:

% process by initex
\input plain

I am attaching a change file that modifies compare_strings()
, cf. scan_general_text() in eTeX.


You can respond by visiting: 

More information about the ntg-pdftex mailing list