diff options
author | Brad King <brad.king@kitware.com> | 2010-02-09 18:31:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-02-09 18:31:12 (GMT) |
commit | 2ec78b4de772920065e81096b90b1f1d2ee42964 (patch) | |
tree | 06cbe730a783dab9c8945a1410adb140165baf42 /Source/CTest/cmCTestBZR.cxx | |
parent | 9ff55c0ebe895128ab28912fadd433353ebfcaff (diff) | |
download | CMake-2ec78b4de772920065e81096b90b1f1d2ee42964.zip CMake-2ec78b4de772920065e81096b90b1f1d2ee42964.tar.gz CMake-2ec78b4de772920065e81096b90b1f1d2ee42964.tar.bz2 |
cmCTestBZR: Strip trailing slashes from paths
Our internal path processing methods assume no trailing slashes, but bzr
adds trailing slashes to updated directories. This can lead to empty
entries in Update.xml files. We address the problem by stripping the
slashes as soon as they are parsed.
Diffstat (limited to 'Source/CTest/cmCTestBZR.cxx')
-rw-r--r-- | Source/CTest/cmCTestBZR.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index d8ec9cd..55b8d5b 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -276,12 +276,14 @@ private: && !this->CData.empty()) { this->CurChange.Path.assign(&this->CData[0], this->CData.size()); + cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); this->Changes.push_back(this->CurChange); } else if(strcmp(name, "symlink") == 0 && !this->CData.empty()) { // symlinks have an arobase at the end in the log this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1); + cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); this->Changes.push_back(this->CurChange); } else if(strcmp(name, "committer") == 0 && !this->CData.empty()) @@ -377,9 +379,10 @@ private: return true; } - void DoPath(char c0, char c1, char c2, std::string const& path) + void DoPath(char c0, char c1, char c2, std::string path) { if(path.empty()) return; + cmSystemTools::ConvertToUnixSlashes(path); const std::string dir = cmSystemTools::GetFilenamePath(path); const std::string name = cmSystemTools::GetFilenameName(path); @@ -488,9 +491,10 @@ private: return true; } - void DoPath(char c0, char c1, char c2, std::string const& path) + void DoPath(char c0, char c1, char c2, std::string path) { if(path.empty()) return; + cmSystemTools::ConvertToUnixSlashes(path); if ( c0=='C' ) { |