summaryrefslogtreecommitdiff
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-17 07:53:57 -0500
committerBrad King <brad.king@kitware.com>2005-02-17 07:53:57 -0500
commit2651d170d554040502b330c41acccbfddbd8122e (patch)
treee0dc76d2ad95c79ea361b999617e5c8bcbdf3ddc /Source/cmake.cxx
parente64f3c8b67f391dc3bb7a30a45f0fedc532fdbde (diff)
downloadcmake-2651d170d554040502b330c41acccbfddbd8122e.tar.gz
BUG: Removing "guess when there is a space in the path" check for chdir command. It is the responsibility of the caller of the command to ensure the arguments are properly quoted on the command line.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 0e0cce8820..e5d59831c3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -774,27 +774,21 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
return 0;
}
- // Clock command
+ // Command to change directory and run a program.
else if (args[1] == "chdir" && args.size() >= 4)
{
std::string directory = args[2];
- unsigned pos = 3;
if(!cmSystemTools::FileExists(directory.c_str()))
{
- directory += " ";
- directory += args[3];
- if(!cmSystemTools::FileExists(directory.c_str()))
- {
- cmSystemTools::Error("Directory does not exist for chdir command (try1): ", args[2].c_str());
- cmSystemTools::Error("Directory does not exist for chdir command (try2): ", directory.c_str());
- }
- pos = 4;
+ cmSystemTools::Error("Directory does not exist for chdir command: ",
+ args[2].c_str());
+ return 0;
}
-
+
std::string command = "\"";
- command += args[pos];
+ command += args[3];
command += "\"";
- for (std::string::size_type cc = pos+1; cc < args.size(); cc ++)
+ for (std::string::size_type cc = 4; cc < args.size(); cc ++)
{
command += " \"";
command += args[cc];