summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-09 08:59:40 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-09 08:59:40 +0000
commit7eaec3227ab8a135f928623326e2847a6d3dcea1 (patch)
tree4de55eed168e4b4415808820fbb348038d2f47f5
parent92563e096f1ac0a0783b7c4f4d05926270d6c136 (diff)
TeX & Co: Apply some changes from W32TeX
git-svn-id: svn://tug.org/texlive/trunk@35338 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c20
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c46
4 files changed, 74 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index f5274865118..ab9bcf3d248 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * texmfmp.c: Apply some code from W32TeX.
+
2014-08-22 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* texmfmp.c: Symplify support of multibyte characters, by
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 9a6fec3137e..a3d7aaa6271 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -932,12 +932,32 @@ main (int ac, string *av)
#endif
#ifdef WIN32
+ av[0] = kpse_program_basename (av[0]);
_setmaxstdio(2048);
setmode(fileno(stdin), _O_BINARY);
#endif
maininit (ac, av);
+#ifdef WIN32
+ if (ac > 1) {
+ char *pp;
+ if ((strlen(av[ac-1]) > 2) &&
+ isalpha(av[ac-1][0]) &&
+ (av[ac-1][1] == ':') &&
+ (av[ac-1][2] == '\\')) {
+ for (pp=av[ac-1]+2; *pp; pp++) {
+ if (IS_KANJI(pp)) {
+ pp++;
+ continue;
+ }
+ if (*pp == '\\')
+ *pp = '/';
+ }
+ }
+ }
+#endif
+
/* Call the real main program. */
mainbody ();
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index e3c1942051e..0e55887a980 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * luatex.c: Apply some code from W32TeX.
+
2014-10-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* luatex.c: Sync with some recent changes in ../lib/texmfmp.c
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index 1b9df5f06e1..9d02f40a686 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -441,6 +441,29 @@ const_string c_job_name;
const char *ptexbanner;
+#ifdef _MSC_VER
+/* Invalid parameter handler */
+static void myInvalidParameterHandler(const wchar_t * expression,
+ const wchar_t * function,
+ const wchar_t * file,
+ unsigned int line,
+ uintptr_t pReserved)
+{
+/*
+ printf(L"Invalid parameter detected in function %s."
+ L" File: %s Line: %d\n", function, file, line);
+ printf(L"Expression: %s\n", expression);
+*/
+/*
+ I return silently to avoid an exit with the error 0xc0000417
+ (invalid parameter) when we use non-embedded fonts in luatex-ja,
+ which works without any problem on Unix systems.
+ I hope it is not dangerous.
+*/
+ return;
+}
+#endif
+
/* The entry point: set up for reading the command line, which will
happen in `topenin', then call the main body. */
@@ -457,6 +480,10 @@ main (int ac, string *av)
# endif
# ifdef WIN32
+# ifdef _MSC_VER
+ _set_invalid_parameter_handler(myInvalidParameterHandler);
+# endif
+ av[0] = kpse_program_basename (av[0]);
_setmaxstdio(2048);
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
setmode(fileno(stdin), _O_BINARY);
@@ -464,6 +491,25 @@ main (int ac, string *av)
lua_initialize(ac, av);
+# ifdef WIN32
+ if (ac > 1) {
+ char *pp;
+ if ((strlen(av[ac-1]) > 2) &&
+ isalpha(av[ac-1][0]) &&
+ (av[ac-1][1] == ':') &&
+ (av[ac-1][2] == '\\')) {
+ for (pp=av[ac-1]+2; *pp; pp++) {
+ if (IS_KANJI(pp)) {
+ pp++;
+ continue;
+ }
+ if (*pp == '\\')
+ *pp = '/';
+ }
+ }
+ }
+# endif
+
/* Call the real main program. */
main_body();