diff options
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 28 |
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); |