summaryrefslogtreecommitdiff
path: root/lib/server/LocalProcessStream.cpp
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-11-09 17:28:58 +0100
committerReinhard Tartler <siretart@tauware.de>2010-11-09 17:28:58 +0100
commit8a937bd354001a190dbe66538aacb353e7c99341 (patch)
tree9db021722d1743482e76f93d00fb97bed32a3ea7 /lib/server/LocalProcessStream.cpp
parentb591c86a418e8d5a0d1c1afd319d9acdad6fd4e3 (diff)
Import upstream version 0.11~rc8~r2714
Diffstat (limited to 'lib/server/LocalProcessStream.cpp')
-rw-r--r--lib/server/LocalProcessStream.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/server/LocalProcessStream.cpp b/lib/server/LocalProcessStream.cpp
index af24de1b..c331a135 100644
--- a/lib/server/LocalProcessStream.cpp
+++ b/lib/server/LocalProcessStream.cpp
@@ -43,13 +43,14 @@
// Created: 12/3/04
//
// --------------------------------------------------------------------------
-std::auto_ptr<IOStream> LocalProcessStream(const char *CommandLine, pid_t &rPidOut)
+std::auto_ptr<IOStream> LocalProcessStream(const std::string& rCommandLine,
+ pid_t &rPidOut)
{
#ifndef WIN32
// Split up command
std::vector<std::string> command;
- SplitString(std::string(CommandLine), ' ', command);
+ SplitString(rCommandLine, ' ', command);
// Build arguments
char *args[MAX_ARGUMENTS + 4];
@@ -137,8 +138,8 @@ std::auto_ptr<IOStream> LocalProcessStream(const char *CommandLine, pid_t &rPidO
startupInfo.hStdInput = INVALID_HANDLE_VALUE;
startupInfo.dwFlags |= STARTF_USESTDHANDLES;
- CHAR* commandLineCopy = (CHAR*)malloc(strlen(CommandLine) + 1);
- strcpy(commandLineCopy, CommandLine);
+ CHAR* commandLineCopy = (CHAR*)malloc(rCommandLine.size() + 1);
+ strcpy(commandLineCopy, rCommandLine.c_str());
BOOL result = CreateProcess(NULL,
commandLineCopy, // command line
@@ -155,7 +156,7 @@ std::auto_ptr<IOStream> LocalProcessStream(const char *CommandLine, pid_t &rPidO
if(!result)
{
- BOX_ERROR("Failed to CreateProcess: '" << CommandLine <<
+ BOX_ERROR("Failed to CreateProcess: '" << rCommandLine <<
"': " << GetErrorMessage(GetLastError()));
CloseHandle(writeInChild);
CloseHandle(readFromChild);