summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/dpxfile.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-01-12 15:14:01 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-01-12 15:14:01 +0000
commitcbf13f50c39f0d3869df7ccf9ad1348a193c48d1 (patch)
tree5d770798b8e898b03da8068f3713853ee1167fda /Build/source/texk/dvipdfm-x/dpxfile.c
parentf4bf26a1af8186c98c64a15d04e4b6a8cbeca85e (diff)
Allow Unicode file names in (x)dvipdfmx on Windows (from T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32644 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dpxfile.c')
-rw-r--r--Build/source/texk/dvipdfm-x/dpxfile.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/Build/source/texk/dvipdfm-x/dpxfile.c b/Build/source/texk/dvipdfm-x/dpxfile.c
index ea956e034ca..d6b7de4f8bf 100644
--- a/Build/source/texk/dvipdfm-x/dpxfile.c
+++ b/Build/source/texk/dvipdfm-x/dpxfile.c
@@ -165,6 +165,9 @@ static int exec_spawn (char *cmd)
char *p, *pp;
char buf[1024];
int i, ret = -1;
+#ifdef WIN32
+ wchar_t **cmdvw, **qvw;
+#endif
if (!cmd)
return -1;
@@ -233,7 +236,16 @@ static int exec_spawn (char *cmd)
qv++;
}
#ifdef WIN32
- ret = spawnvp (_P_WAIT, *cmdv, (const char* const*) cmdv);
+ cmdvw = xcalloc (i + 2, sizeof (wchar_t *));
+ qv = cmdv;
+ qvw = cmdvw;
+ while (*qv) {
+ *qvw = get_wstring_from_fsyscp(*qv, *qvw=NULL);
+ qv++;
+ qvw++;
+ }
+ *qvw = NULL;
+ ret = _wspawnvp (_P_WAIT, *cmdvw, (const wchar_t* const*) cmdvw);
#else
i = fork ();
if (i < 0)
@@ -256,6 +268,16 @@ done:
qv++;
}
free (cmdv);
+#ifdef WIN32
+ if (cmdvw) {
+ qvw = cmdvw;
+ while (*qvw) {
+ free (*qvw);
+ qvw++;
+ }
+ free (cmdvw);
+ }
+#endif
return ret;
}