texlive[51119] Build/source/texk/web2c/lib: improve support of
commits+kakuto at tug.org
commits+kakuto at tug.org
Tue May 14 06:53:31 CEST 2019
Revision: 51119
http://tug.org/svn/texlive?view=revision&revision=51119
Author: kakuto
Date: 2019-05-14 06:53:31 +0200 (Tue, 14 May 2019)
Log Message:
-----------
improve support of non-ascii file names (Windows only)
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 2019-05-13 23:39:06 UTC (rev 51118)
+++ trunk/Build/source/texk/web2c/lib/ChangeLog 2019-05-14 04:53:31 UTC (rev 51119)
@@ -1,3 +1,8 @@
+2019-05-14 Akira Kakuto <kakuto at w32tex.org>
+
+ * texmfmp.c: Support non-ascii file names in special cases
+ implemented in a previous change on 2019-05-08 (Windows only).
+
2019-05-08 Akira Kakuto <kakuto at w32tex.org>
* texmfmp.c: Introduce a new function find_input_file(s)
Modified: trunk/Build/source/texk/web2c/lib/texmfmp.c
===================================================================
--- trunk/Build/source/texk/web2c/lib/texmfmp.c 2019-05-13 23:39:06 UTC (rev 51118)
+++ trunk/Build/source/texk/web2c/lib/texmfmp.c 2019-05-14 04:53:31 UTC (rev 51119)
@@ -147,7 +147,7 @@
}
#endif
-#ifdef WIN32
+#ifdef _WIN32
#if !IS_pTeX
FILE *Poptr;
#endif
@@ -162,12 +162,35 @@
int ret;
wpath = get_wstring_from_mbstring(file_system_codepage,
path, wpath = NULL);
+ if (wpath == NULL)
+ return -1;
ret = _wstat(wpath, buffer);
free(wpath);
return ret;
}
-#endif /* WIN32 */
+#include <sys/stat.h>
+int fsyscp_dir_p(char *path)
+{
+ struct stat stats;
+ int ret;
+ ret = fsyscp_stat(path, &stats) == 0 && S_ISDIR (stats.st_mode);
+ return ret;
+}
+int fsyscp_access(const char *path, int mode)
+{
+ wchar_t *wpath;
+ int ret;
+ wpath = get_wstring_from_mbstring(file_system_codepage,
+ path, wpath = NULL);
+ if (wpath == NULL)
+ return -1;
+ ret = _waccess(wpath, mode);
+ free(wpath);
+ return ret;
+}
+#endif /* _WIN32 */
+
#if defined(TeX) || (defined(MF) && defined(WIN32))
static int
Isspace (char c)
@@ -3094,6 +3117,13 @@
}
}
+#if defined(_WIN32)
+#undef access
+#undef dir_p
+#define access fsyscp_access
+#define dir_p fsyscp_dir_p
+#endif /* _WIN32 */
+
/* Search for an input file. If -output-directory is specified look
there first. If that fails, do the regular kpse search. */
string
More information about the tex-live-commits
mailing list