diff options
Diffstat (limited to 'Build/source/texk/web2c/lib/texmfmp.c')
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 22 |
1 files changed, 21 insertions, 1 deletions
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) |