# HG changeset patch # User Karl Heuer # Date 770619017 0 # Node ID f9cde332098701962e2c0666b498b1e2b4264863 # Parent 2226c7efb3dad3f09276b292edf76ed682c4ef16 (run_msdos_command): Make local copy of argv[2] on stack, not on heap. (run_msdos_command): When changing argv[2] from using slashes to using backslashes, only do so on the first white-space delimited part. diff -r 2226c7efb3da -r f9cde3320987 src/msdos.c --- a/src/msdos.c Fri Jun 03 04:08:32 1994 +0000 +++ b/src/msdos.c Fri Jun 03 04:50:17 1994 +0000 @@ -527,11 +527,20 @@ if (msshell) { saveargv1 = argv[1]; + saveargv2 = argv[2]; argv[1] = "/c"; if (argv[2]) { - saveargv2 = argv[2]; - unixtodos_filename (argv[2] = strdup (argv[2])); + char *p = alloca (strlen (argv[2]) + 1); + + strcpy (argv[2] = p, saveargv2); + while (*p && isspace (*p)) + p++; + while (*p && !isspace (*p)) + if (*p == '/') + *p++ = '\\'; + else + p++; } } @@ -578,11 +587,7 @@ if (msshell) { argv[1] = saveargv1; - if (argv[2]) - { - free (argv[2]); - argv[2] = saveargv2; - } + argv[2] = saveargv2; } return result; }