summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/search.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2010-05-24 15:56:25 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2010-05-24 15:56:25 +0000
commitc93d46e6e839f6b8735f7d5debc7aaf9e92bd45d (patch)
tree1b5fe401c7e295db5425b9ee45d6a3ee1111bcab /Build/source/texk/dvipsk/search.c
parent2955d47562cb9423130327ebbb4493f62e9d6d7d (diff)
quote command in WIN32 case.
git-svn-id: svn://tug.org/texlive/trunk@18449 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk/search.c')
-rw-r--r--Build/source/texk/dvipsk/search.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c
index e135ef2cd67..615802f2b6c 100644
--- a/Build/source/texk/dvipsk/search.c
+++ b/Build/source/texk/dvipsk/search.c
@@ -75,16 +75,28 @@ selfautoloc_prog (const char *prog)
{
char *ret;
#ifdef WIN32
- char *p;
+ char *p, *q, *r;
/* Get value of SELFAUTOLOC, but \ works better for path separator. */
char *selfautoloc = kpse_var_value ("SELFAUTOLOC");
for (p = selfautoloc; *p; p++) {
if (*p == '/')
*p = '\\';
}
-
- /* Prepend that to PROG. */
- ret = concat3 (selfautoloc, "\\", prog);
+ q = xstrdup (prog);
+ r = q;
+ while (*r && *r != ' ' && *r != '\t')
+ r++;
+ if (*r == '\0')
+ ret = (char *)concatn ("\"", selfautoloc, "\\", q, "\"", NULL);
+ else {
+ *r = '\0';
+ r++;
+ if (*r)
+ ret = (char *)concatn ("\"", selfautoloc, "\\", q, "\" ", r, NULL);
+ else
+ ret = (char *)concatn ("\"", selfautoloc, "\\", q, "\"", NULL);
+ }
+ free (q);
free (selfautoloc);
#else /* not WIN32 */