[Dev-luatex] [PATCH] Respect find_{output,write}_file result
Hans Hagen
j.hagen at xs4all.nl
Sun May 26 18:33:56 CEST 2019
On 5/26/2019 2:26 PM, Marcel Fabian Krüger wrote:
> Hi,
>
> according to the documentation find_{output,write}_file should return
> the name of the to be written file. Currently this is mostly ignored and
> the original name is always used. Here is a patch to fix this.
>
> Best regards,
> Marcel Krüger
> ---
> source/texk/web2c/luatexdir/tex/texfileio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/source/texk/web2c/luatexdir/tex/texfileio.c b/source/texk/web2c/luatexdir/tex/texfileio.c
> index 143e694e1..158757080 100644
> --- a/source/texk/web2c/luatexdir/tex/texfileio.c
> +++ b/source/texk/web2c/luatexdir/tex/texfileio.c
> @@ -347,7 +347,7 @@ boolean lua_a_open_out(alpha_file * f, char *fn, int n)
> messaging is left to \LUA\ then.
>
> */
> - ret = open_outfile(f, fn, FOPEN_W_MODE);
> + ret = open_outfile(f, str_string(fnam), FOPEN_W_MODE);
> }
> } else {
> if (openoutnameok(fn)) {
> @@ -379,7 +379,7 @@ boolean lua_b_open_out(alpha_file * f, char *fn)
> fnam = 0;
> test = run_callback(callback_id, "S->s", fn, &fnam);
> if ((test) && (fnam != 0) && (str_length(fnam) > 0)) {
> - ret = open_outfile(f, fn, FOPEN_WBIN_MODE);
> + ret = open_outfile(f, str_string(fnam), FOPEN_WBIN_MODE);
> }
> } else {
> if (openoutnameok(fn)) {
indeed a bug but the solution is a bit different as we can avoid going
via the string pool
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
-----------------------------------------------------------------
More information about the dev-luatex
mailing list