On 6/12/2026 6:38 AM, Jonathan Gruber wrote:
In a number of places in ConTeXt's source code, kpse.expand_var is
used to evaluate a texmfcnf configuration variable when
kpse.expand_braces would be the more correct choice. The files that I
have found containing this mistake are
tex/generic/context/luatex/luatex-basics-gen.lua and
tex/generic/context/luatex/luatex-fonts-merged.lua in the ConTeXt
GitHub repository. In both files, kpse.expand_var is used to evaluate
a texmfcnf configuration variable, and the resulting value is then
split into colon- or semicolon-separated components that are then
looped over (similar to how one splits the PATH environment variable
into colon- or semicolon-separated components (depending on the
operating system) and loops over those components to find an
executable).

If a texmfcnf variable, say A, is set to an expression containing
braces, say {a,b}/c, then one clearly intends for the value of A to
expand into a/c:b/c and then split into a/c and b/c. kpse.expand_var
would expand A into {a,b}/c, in which case A would not be split
correctly. kpse.expand_braces would expand A into a/c:b/c, which would
correctly split A into a/c and b/c.

I have attached a patch to correct the bugs.

Here I only need to patch the gen file because the other is a merged file generated when we update. I assume you tested it as I don't have a setup for that.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
_______________________________________________
dev-context mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to