From 1947d48bd0268a06525c8ab38f88729fadc6245d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 6 May 2007 23:11:32 +0000 Subject: [PATCH] fix command-line construction in subprocess for Windows where an argument contains a space or quote and ends with a backslash svn: r6163 --- src/mzscheme/src/port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mzscheme/src/port.c b/src/mzscheme/src/port.c index 5e31f68393..13803e5427 100644 --- a/src/mzscheme/src/port.c +++ b/src/mzscheme/src/port.c @@ -6926,7 +6926,7 @@ static char *cmdline_protect(char *s) char *p; int wrote_slash = 0; - naya = scheme_malloc_atomic(strlen(s) + 3 + 3*has_quote); + naya = scheme_malloc_atomic(strlen(s) + 3 + 3*has_quote + was_slash); naya[0] = '"'; for (p = naya + 1; *s; s++) { if (*s == '"') { @@ -6946,6 +6946,9 @@ static char *cmdline_protect(char *s) wrote_slash = 0; } } + while (wrote_slash--) { + *(p++) = '\\'; + } *(p++) = '"'; *p = 0;