summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-05-12 13:10:47 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-05-12 13:10:47 +0000
commit5a2088fb580bc7efaadc140428e997c45827be9b (patch)
tree782be4158b8045cb71236ffcb6d2c8e2a81aa8e1
parent96a1234bebb746bc96c73909e7f81f5bb2a342ff (diff)
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
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 6b63bfc99c9..4f021c53fa9 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-12 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * texmfmp.c: Allow non-ascii file names for pdfTeX (w32 only).
+ Changes on 2018-05-11 was incomplete.
+
2018-05-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* texmfmp.c: Allow non-ascii file names for pdfTeX (w32 only).
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 <wchar.h>
+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];