diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-25 17:16:05 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-25 17:16:05 (GMT) |
commit | 626be7884ad0261b0e4ca52fd58a0c8d79a86ae6 (patch) | |
tree | b4a25cdcfdb469bd27f2e6b203f723076df68918 /Source/cmSystemTools.cxx | |
parent | a3798b2cbf88fdbda1cb010388bc98f394a18945 (diff) | |
download | CMake-626be7884ad0261b0e4ca52fd58a0c8d79a86ae6.zip CMake-626be7884ad0261b0e4ca52fd58a0c8d79a86ae6.tar.gz CMake-626be7884ad0261b0e4ca52fd58a0c8d79a86ae6.tar.bz2 |
FIX: go back to not trying to handle spaces in the path for run single command and comment it so that people know to call the right thing
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index b235b8c..e2f830f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -427,54 +427,25 @@ bool cmSystemTools::RunSingleCommand( verbose = false; } - std::string program; // store name of program must be in scope function as it - // is put into argv list as a cont char* - std::vector<cmStdString> args; // store the program and args program is args[0] - std::vector<const char*> argv; // store args in a format so that process cmsysProcess can use it - // check to see if the command contains a double quoted string at the start - // if so, then just use parse arguments to split things up - if(command && *command == '\"') - { - args = cmSystemTools::ParseArguments(command); - } - else + std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); + + if(args.size() < 1) { - std::string argsTemp; // Store the arguments to the program - cmSystemTools::SplitProgramFromArgs(command, program, argsTemp); - // if there is no program to run then return false - if(program.size() < 1) - { - // check for a bad call to SplitProgramFromArgs - if(strlen(command) >= 1) - { - cmSystemTools::Error("Error in SplitProgramFromArgs for: ", command); - } - return false; - } - argv.push_back(program.c_str()); // put program in as argv[0] - if(argsTemp.size()) - { - args = cmSystemTools::ParseArguments(argsTemp.c_str()); - } + return false; } - // copy args into argv + + std::vector<const char*> argv; for(std::vector<cmStdString>::const_iterator a = args.begin(); a != args.end(); ++a) { argv.push_back(a->c_str()); } - // null terminate array argv.push_back(0); - // if the only argument is null then there is nothing to run and return false - if(!argv[0]) - { - return false; - } - if ( output ) { *output = ""; } + cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetCommand(cp, &*argv.begin()); cmsysProcess_SetWorkingDirectory(cp, dir); @@ -565,7 +536,6 @@ bool cmSystemTools::RunSingleCommand( } cmsysProcess_Delete(cp); - return result; } bool cmSystemTools::RunCommand(const char* command, |