summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog6
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c41
-rw-r--r--Build/source/texk/web2c/synctexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex.c5
4 files changed, 55 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index b0d9c472d10..7fd406f1aee 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-07 Akira Kakuto <kakuto@w32tex.org>
+
+ * texmfmp.c: Improve support of non-ascii path names in
+ synctex. Support -cnf-line=command_line_encoding=value.
+ These changes are for Windows only.
+
2019-08-06 Karl Berry <karl@freefriends.org>
* texmfmp.c (long_options): new option --cnf-line.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 5ebb35c84c1..75accd7288b 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -131,9 +131,18 @@
--output-directory option is given.
Borrowed from LuaTeX.
*/
+#if defined(_WIN32)
+#if defined(pdfTeX) || defined(upTeX) || defined(eupTeX) || defined(XeTeX) || defined(LuaTeX) || defined(LuajitTeX)
+#define W32USYNCTEX 1
+#endif
+#endif
+
char *generic_synctex_get_current_name (void)
{
char *pwdbuf, *ret;
+#if defined(W32USYNCTEX)
+ wchar_t *wpwd;
+#endif /* W32USYNCTEX */
if (!fullnameoffile) {
ret = xstrdup("");
return ret;
@@ -142,6 +151,14 @@ char *generic_synctex_get_current_name (void)
return xstrdup(fullnameoffile);
}
pwdbuf = xgetcwd();
+#if defined(W32USYNCTEX)
+ if (file_system_codepage != 0 && file_system_codepage != win32_codepage) {
+ wpwd = get_wstring_from_mbstring(win32_codepage, pwdbuf, wpwd=NULL);
+ free (pwdbuf);
+ pwdbuf = get_mbstring_from_wstring(file_system_codepage, wpwd, pwdbuf=NULL);
+ free (wpwd);
+ }
+#endif /* W32USYNCTEX */
ret = concat3(pwdbuf, DIR_SEP_STRING, fullnameoffile);
free(pwdbuf) ;
return ret;
@@ -750,6 +767,30 @@ maininit (int ac, string *av)
kpse_set_program_name (argv[0], NULL);
#endif
#if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
+/*
+ -cnf-line=command_line_encoding=value cannot give effect because
+ command_line_encoding is read here before parsing the command
+ line. So we add the following.
+*/
+ { /* support old compilers which are incompatible with C99 */
+ int n;
+ for (n = 1; n < ac; n++) {
+ if (!strncasecmp (av[n], "-cnf-line=command_line_encoding=", 32)) {
+ putenv (av[n] + 10);
+ break;
+ }
+ if (!strncasecmp (av[n], "--cnf-line=command_line_encoding=", 33)) {
+ putenv (av[n] + 11);
+ break;
+ }
+ if (n < ac - 1 && (!strncasecmp (av[n], "-cnf-line", 9) ||
+ !strncasecmp (av[n], "--cnf-line", 10)) &&
+ !strncasecmp (av[n+1], "command_line_encoding=", 22)) {
+ putenv (av[n+1]);
+ break;
+ }
+ }
+ }
enc = kpse_var_value("command_line_encoding");
get_command_line_args_utf8(enc, &argc, &argv);
#endif
diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog
index a49d19d71c1..c33ca0d9f47 100644
--- a/Build/source/texk/web2c/synctexdir/ChangeLog
+++ b/Build/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-07 Akira Kakuto <kakuto@w32tex.org>
+
+ * synctex.c: Improve support of non-ascii path names
+ (Windows only).
+
2018-10-25 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* synctex.c: Cleanup for non-ascii file names (w32 only).
diff --git a/Build/source/texk/web2c/synctexdir/synctex.c b/Build/source/texk/web2c/synctexdir/synctex.c
index 598c2b30456..ae1334d61e2 100644
--- a/Build/source/texk/web2c/synctexdir/synctex.c
+++ b/Build/source/texk/web2c/synctexdir/synctex.c
@@ -293,7 +293,7 @@ mem[NODE+TYPE##_node_size-synchronization_field_size+1].cint
# endif
#if defined(_WIN32)
-#if defined(pdfTeX) || defined(upTeX) || defined(eupTeX) || defined(XeTeX)
+#if defined(pdfTeX) || defined(upTeX) || defined(eupTeX) || defined(XeTeX) || defined(LuaTeX) || defined(LuajitTeX)
#define W32UPTEXSYNCTEX 1
#include <wchar.h>
static char *chgto_oem(char *src);
@@ -591,7 +591,8 @@ static int fsyscp_rename(char *s1, char *s2)
}
#undef fopen
-#define fopen fsyscp_fopen
+extern FILE *f_fsyscp_fopen(const char *filename, const char *mode);
+#define fopen f_fsyscp_fopen
#define gzopen fsyscp_gzopen
#define rename fsyscp_rename
#define remove fsyscp_remove