diff options
| author | Jeff Cohen <jeffc@jolt-lang.org> | 2005-02-16 04:43:45 +0000 |
|---|---|---|
| committer | Jeff Cohen <jeffc@jolt-lang.org> | 2005-02-16 04:43:45 +0000 |
| commit | 97a41e238ebd232d6f65f87dc67997705e330a71 (patch) | |
| tree | 9094996db5f0a0f1832aafdabc906104b735f5f7 /llvm/lib/System/Win32 | |
| parent | c28fd0db2ea0249e05c8a87b1c7eed22832e782e (diff) | |
| download | bcm5719-llvm-97a41e238ebd232d6f65f87dc67997705e330a71.tar.gz bcm5719-llvm-97a41e238ebd232d6f65f87dc67997705e330a71.zip | |
Arg list already has program name in it.
llvm-svn: 20208
Diffstat (limited to 'llvm/lib/System/Win32')
| -rw-r--r-- | llvm/lib/System/Win32/Program.inc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/lib/System/Win32/Program.inc b/llvm/lib/System/Win32/Program.inc index 2d3580d3db3..71d0c2f7c16 100644 --- a/llvm/lib/System/Win32/Program.inc +++ b/llvm/lib/System/Win32/Program.inc @@ -81,11 +81,7 @@ Program::ExecuteAndWait(const Path& path, // have embedded spaces. // First, determine the length of the command line. - std::string progname(path.getLast()); - unsigned len = progname.length() + 1; - if (progname.find(' ') != std::string::npos) - len += 2; - + unsigned len = 0; for (unsigned i = 0; args[i]; i++) { len += strlen(args[i]) + 1; if (strchr(args[i], ' ')) @@ -96,19 +92,10 @@ Program::ExecuteAndWait(const Path& path, char *command = reinterpret_cast<char *>(_alloca(len)); char *p = command; - bool needsQuoting = progname.find(' ') != std::string::npos; - if (needsQuoting) - *p++ = '"'; - memcpy(p, progname.c_str(), progname.length()); - p += progname.length(); - if (needsQuoting) - *p++ = '"'; - *p++ = ' '; - for (unsigned i = 0; args[i]; i++) { const char *arg = args[i]; size_t len = strlen(arg); - needsQuoting = strchr(arg, ' ') != 0; + bool needsQuoting = strchr(arg, ' ') != 0; if (needsQuoting) *p++ = '"'; memcpy(p, arg, len); |

