diff options
author | Brad King <brad.king@kitware.com> | 2006-03-14 15:14:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-03-14 15:14:52 (GMT) |
commit | c332ff41f10f6ef50dcaf806314696f3d9e79250 (patch) | |
tree | 9d0218557b982525dc9b6ddc8d1cd23f2a10a6c6 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 6018c2799374ddad7d3eb96618dfcca74a915e93 (diff) | |
download | CMake-c332ff41f10f6ef50dcaf806314696f3d9e79250.zip CMake-c332ff41f10f6ef50dcaf806314696f3d9e79250.tar.gz CMake-c332ff41f10f6ef50dcaf806314696f3d9e79250.tar.bz2 |
BUG: Avoid full paths and spaces when constructing object file names.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 340d50a..72cb2b6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -929,9 +929,20 @@ cmLocalUnixMakefileGenerator3::CreateSafeUniqueObjectFileName(const char* sin) // Start with the original name. std::string ssin = sin; + // Avoid full paths by removing leading slashes. + std::string::size_type pos = 0; + for(;pos < ssin.size() && ssin[pos] == '/'; ++pos); + ssin = ssin.substr(pos); + + // Avoid full paths by removing colons. + cmSystemTools::ReplaceString(ssin, ":", "_"); + // Avoid relative paths that go up the tree. cmSystemTools::ReplaceString(ssin, "../", "__/"); + // Avoid spaces. + cmSystemTools::ReplaceString(ssin, " ", "_"); + // Mangle the name if necessary. if(m_Makefile->IsOn("CMAKE_MANGLE_OBJECT_FILE_NAMES")) { |