From 1058a967eb971e15a44d920cfaa93fad0c0b78b9 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 3 Jun 2011 13:13:27 +0000 Subject: fix a bug in exec_spawn() git-svn-id: svn://tug.org/texlive/trunk@22761 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfmx/ChangeLog | 4 ++++ .../texk/dvipdfmx/dvipdfmx-20110311/src/dpxfile.c | 23 ++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/dvipdfmx/ChangeLog b/Build/source/texk/dvipdfmx/ChangeLog index 1ed18d83fc0..48e5bc3f654 100644 --- a/Build/source/texk/dvipdfmx/ChangeLog +++ b/Build/source/texk/dvipdfmx/ChangeLog @@ -1,3 +1,7 @@ +2011-06-03 Akira Kakuto + + * dpxfile.c: fix a bug in exec_spawn(). + 2011-06-03 Peter Breitenlohner * Makefile.am (mapdata*): Do install the map file, still needed diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20110311/src/dpxfile.c b/Build/source/texk/dvipdfmx/dvipdfmx-20110311/src/dpxfile.c index b8267374bb4..16c81eaf503 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20110311/src/dpxfile.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20110311/src/dpxfile.c @@ -154,7 +154,7 @@ static int exec_spawn (char *cmd) { char **cmdv, **qv; char *p, *pp; - char buf[512]; + char buf[1024]; int i, ret; if (!cmd || !*cmd) @@ -194,17 +194,21 @@ static int exec_spawn (char *cmd) } p++; } else { - while (*p != ' ' && *p != '\t' && *p) -#ifdef WIN32 + while (*p != ' ' && *p != '\t' && *p) { if (*p == '\'') { - *pp++ = '\"'; + p++; + while (*p != '\'') { + if (*p == '\0') { + free (cmdv); + return -1; + } + *pp++ = *p++; + } p++; } else { *pp++ = *p++; } -#else - *pp++ = *p++; -#endif + } } *pp = '\0'; if ((pp = strchr (buf, ' ')) || (pp = strchr (buf, '\t'))) { @@ -214,8 +218,11 @@ static int exec_spawn (char *cmd) *qv = concat3 ("'", buf, "'"); #endif } else { - *qv = concat (buf, ""); + *qv = xstrdup (buf); } +/* + fprintf(stderr,"\n%s", *qv); +*/ while (*p == ' ' || *p == '\t') p++; qv++; -- cgit v1.2.3