diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-17 15:28:41 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-17 15:28:41 (GMT) |
commit | 68d9a5d404691fc309bb813127e983b4336a3923 (patch) | |
tree | a1d62ce1050336dc204a8948a4fd33fafe743a7e | |
parent | 0510292b9e4d1c7fc2a25710974fda166db0742b (diff) | |
download | CMake-68d9a5d404691fc309bb813127e983b4336a3923.zip CMake-68d9a5d404691fc309bb813127e983b4336a3923.tar.gz CMake-68d9a5d404691fc309bb813127e983b4336a3923.tar.bz2 |
remove trailing slash from findpath command
-rw-r--r-- | Source/cmFindPathCommand.cxx | 6 | ||||
-rw-r--r-- | Tests/Complex/Executable/complex.cxx | 7 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Executable/complex.cxx | 7 | ||||
-rw-r--r-- | Tests/ComplexRelativePaths/Executable/complex.cxx | 7 |
4 files changed, 17 insertions, 10 deletions
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index dd7c870..6261187 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -86,7 +86,11 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn) tryPath += args[1]; if(cmSystemTools::FileExists(tryPath.c_str())) { - path[k] = cmSystemTools::CollapseFullPath(path[k].c_str()); + path[k] = cmSystemTools::CollapseFullPath(path[k].c_str()); + if(path[k].size() && path[k][path[k].size()-1] == '/') + { + path[k] = path[k].substr(0, path[k].size()-1); + } m_Makefile->AddCacheDefinition(args[0].c_str(), path[k].c_str(), helpString.c_str(), diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 49b439f..2679722 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -42,9 +42,9 @@ void ForceStringUse() // ====================================================================== -void cmFailed(const char* Message, const char* m2= "") +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") { - std::cout << "FAILED: " << Message << m2 << "\n"; + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; cm_failed++; } @@ -774,10 +774,11 @@ int main() #ifndef REGISTRY_TEST_PATH cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined."); #else + std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) { cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", - REGISTRY_TEST_PATH); + REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); } else { diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 49b439f..2679722 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -42,9 +42,9 @@ void ForceStringUse() // ====================================================================== -void cmFailed(const char* Message, const char* m2= "") +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") { - std::cout << "FAILED: " << Message << m2 << "\n"; + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; cm_failed++; } @@ -774,10 +774,11 @@ int main() #ifndef REGISTRY_TEST_PATH cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined."); #else + std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) { cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", - REGISTRY_TEST_PATH); + REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); } else { diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 49b439f..2679722 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -42,9 +42,9 @@ void ForceStringUse() // ====================================================================== -void cmFailed(const char* Message, const char* m2= "") +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") { - std::cout << "FAILED: " << Message << m2 << "\n"; + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; cm_failed++; } @@ -774,10 +774,11 @@ int main() #ifndef REGISTRY_TEST_PATH cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined."); #else + std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) { cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", - REGISTRY_TEST_PATH); + REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); } else { |