summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-08 08:27:03 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-10-08 08:27:03 +0000
commit493998a8e5601018e974451a4aa1621d752698bb (patch)
treec3079b80fff0ccc00fa57869f250bf21bdf0dae9 /Build/source/texk/web2c
parenta0bf5a0634d9ee69a111d574784b485096c45c16 (diff)
LuaTeX: Apply some recent changes from texk/web2c/lib/texmfmp.c
git-svn-id: svn://tug.org/texlive/trunk@35331 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c28
2 files changed, 15 insertions, 18 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 8602a488d12..e3c1942051e 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-08 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * luatex.c: Sync with some recent changes in ../lib/texmfmp.c
+ (and luatexfirst.c from W32TeX).
+
2014-09-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/luatex.am: Factor out common *_LDADD and *_DEPENDENCIES.
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index b98c250493b..1b9df5f06e1 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -113,40 +113,31 @@ void mk_shellcmdlist(char *v)
{
char **p;
char *q, *r;
- unsigned int n;
+ size_t n;
q = v;
- n = 0;
+ n = 1;
/* analyze the variable shell_escape_commands = foo,bar,...
spaces before and after (,) are not allowed. */
while ((r = strchr(q, ',')) != 0) {
n++;
- r++;
- q = r;
+ q = r + 1;
}
if (*q)
n++;
- cmdlist = (char **) xmalloc((unsigned) ((n + 1) * sizeof(char *)));
+ cmdlist = (char **) xmalloc(n * sizeof(char *));
p = cmdlist;
q = v;
while ((r = strchr(q, ',')) != 0) {
*r = '\0';
- *p = (char *) xmalloc((unsigned) strlen(q) + 1);
- strcpy(*p, q);
- *r = ',';
- r++;
- q = r;
- p++;
+ *p++ = xstrdup (q);
+ q = r + 1;
}
- if (*q) {
- *p = (char *) xmalloc((unsigned) strlen(q) + 1);
- strcpy(*p, q);
- p++;
- *p = NULL;
- } else
- *p = NULL;
+ if (*q)
+ *p++ = xstrdup (q);
+ *p = NULL;
}
/* Called from maininit. Not static because also called from
@@ -468,6 +459,7 @@ main (int ac, string *av)
# ifdef WIN32
_setmaxstdio(2048);
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
+ setmode(fileno(stdin), _O_BINARY);
# endif
lua_initialize(ac, av);