From 5a2088fb580bc7efaadc140428e997c45827be9b Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 12 May 2018 13:10:47 +0000 Subject: Allow non-ascii file names for pdfTeX (w32 only). Changes on 2018-05-11 was incomplete. git-svn-id: svn://tug.org/texlive/trunk@47688 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/texmfmp.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'Build/source/texk/web2c/lib/texmfmp.c') diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 04cb39e9522..7c8556f1a5e 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -1376,6 +1376,24 @@ tcx_get_num (int upb, /* FIXME: A new format ought to be introduced for these files. */ +#ifdef _WIN32 +#undef fopen +#undef xfopen +#define fopen fsyscp_fopen +#define xfopen fsyscp_xfopen +#include +int fsyscp_stat(const char *path, struct stat *buffer) +{ + wchar_t *wpath; + int ret; + wpath = get_wstring_from_mbstring(kpse_def->File_system_codepage, + path, wpath = NULL); + ret = _wstat(wpath, buffer); + free(wpath); + return ret; +} +#endif /* WIN32 */ + void readtcxfile (void) { @@ -3137,7 +3155,11 @@ void getfilemoddate(integer s) recorder_record_input(file_name); /* get file status */ +#ifdef _WIN32 + if (fsyscp_stat(file_name, &file_data) == 0) { +#else if (stat(file_name, &file_data) == 0) { +#endif size_t len; makepdftime(file_data.st_mtime, time_str, /* utc= */false); @@ -3167,7 +3189,11 @@ void getfilesize(integer s) recorder_record_input(file_name); /* get file status */ +#ifdef _WIN32 + if (fsyscp_stat(file_name, &file_data) == 0) { +#else if (stat(file_name, &file_data) == 0) { +#endif size_t len; char buf[20]; -- cgit v1.2.3