* spawn.cc (spawn_guts): Use \ for quoting '"'.

* dcrt0.cc (quoted): Understand \ quoting for '"'.
This commit is contained in:
Christopher Faylor
2000-07-16 06:31:06 +00:00
parent 2768430b64
commit 8e382d8049
3 changed files with 29 additions and 17 deletions

View File

@ -407,16 +407,17 @@ spawn_guts (HANDLE hToken, const char * prog_arg, const char *const *argv,
newargv0 = NULL;
int len = strlen (a);
if (len != 0 && !(p = strpbrk (a, " \t\n\r\"")))
if (len != 0 && !strpbrk (a, " \t\n\r\""))
one_line.add (a, len);
else
{
one_line.add ("\"", 1);
for (; p; a = p, p = strchr (p, '"'))
for (0; p = strpbrk (a, "\"\\"); a = ++p)
{
one_line.add (a, ++p - a);
if (p[-1] == '"')
one_line.add ("\"", 1);
one_line.add (a, p - a);
if (*p == '\\' || *p == '"')
one_line.add ("\\", 1);
one_line.add (p, 1);
}
if (*a)
one_line.add (a);