texlive[47688] Build/source/texk/web2c/lib: Allow non-ascii file
commits+kakuto at tug.org
commits+kakuto at tug.org
Sat May 12 15:10:47 CEST 2018
Revision: 47688
http://tug.org/svn/texlive?view=revision&revision=47688
Author: kakuto
Date: 2018-05-12 15:10:47 +0200 (Sat, 12 May 2018)
Log Message:
-----------
Allow non-ascii file names for pdfTeX (w32 only). Changes on 2018-05-11 was incomplete.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/lib/ChangeLog
trunk/Build/source/texk/web2c/lib/texmfmp.c
Modified: trunk/Build/source/texk/web2c/lib/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/lib/ChangeLog 2018-05-12 11:19:50 UTC (rev 47687)
+++ trunk/Build/source/texk/web2c/lib/ChangeLog 2018-05-12 13:10:47 UTC (rev 47688)
@@ -1,3 +1,8 @@
+2018-05-12 Akira Kakuto <kakuto at 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 at fuk.kindai.ac.jp>
* texmfmp.c: Allow non-ascii file names for pdfTeX (w32 only).
Modified: trunk/Build/source/texk/web2c/lib/texmfmp.c
===================================================================
--- trunk/Build/source/texk/web2c/lib/texmfmp.c 2018-05-12 11:19:50 UTC (rev 47687)
+++ trunk/Build/source/texk/web2c/lib/texmfmp.c 2018-05-12 13:10:47 UTC (rev 47688)
@@ -1376,6 +1376,24 @@
/* 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 @@
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 @@
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];
More information about the tex-live-commits
mailing list