diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2022-03-08 12:25:05 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2022-03-08 12:25:05 +0000 |
commit | b2b69e7a581da37faffd059d5ab61dba6e3da5f0 (patch) | |
tree | 678c55bef4b10eacdc0d322846fad17c991f703f /Build/source | |
parent | 830456e8d1a21e8b7d6aabf36422cc7170bedfb7 (diff) |
texmfmp.c: Convert filename to utf8 in find_input_file for pTeX (H. Kitagawa)
git-svn-id: svn://tug.org/texlive/trunk@62514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 22 |
2 files changed, 26 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 35f2bdd9de4..9255a995730 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,8 @@ +2022-03-08 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> + + * texmfmp.c: Convert filename to utf8 in find_input_file for pTeX. + https://github.com/texjporg/tex-jp-build/issues/45 + 2022-03-03 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> * texmfmp.c: Convert the argument of runpopen to utf8 for pTeX. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index c589244d93a..6dc2b22119a 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -3398,12 +3398,20 @@ string find_input_file(integer s) { string filename; - +#if IS_pTeX && !defined(WIN32) + string fname0; string fname1 = NULL; +#endif #if defined(XeTeX) filename = gettexstring(s); #else filename = makecfilename(s); #endif +#if IS_pTeX && !defined(WIN32) + fname0 = ptenc_from_internal_enc_string_to_utf8(filename); + if (fname0) { + fname1 = filename; filename = fname0; + } +#endif /* Look in -output-directory first, if the filename is not absolute. This is because we want the pdf* functions to be able to find the same files as \openin */ @@ -3412,14 +3420,26 @@ find_input_file(integer s) pathname = concat3(output_directory, DIR_SEP_STRING, filename); if (!access(pathname, R_OK) && !dir_p (pathname)) { +#if IS_pTeX && !defined(WIN32) + if (fname1) free(filename); +#endif return pathname; } xfree (pathname); } if (! kpse_in_name_ok(filename)) { +#if IS_pTeX && !defined(WIN32) + if (fname1) free(filename); +#endif return NULL; /* no permission */ } +#if IS_pTeX && !defined(WIN32) + fname0 = kpse_find_tex(filename); + if (fname1) free(filename); + return fname0; +#else return kpse_find_tex(filename); +#endif } #if !defined(XeTeX) |