diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-02-15 14:58:58 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-02-15 14:58:58 (GMT) |
commit | 3675a6e3a7a31856e4c5d160fd58eb45bc5e10eb (patch) | |
tree | 5302a0e4d11d1b57d85982b6e8bce4c9ba834df5 /Source/kwsys | |
parent | 4601c46ad8dd30d089a474f49e87a79df7268088 (diff) | |
download | CMake-3675a6e3a7a31856e4c5d160fd58eb45bc5e10eb.zip CMake-3675a6e3a7a31856e4c5d160fd58eb45bc5e10eb.tar.gz CMake-3675a6e3a7a31856e4c5d160fd58eb45bc5e10eb.tar.bz2 |
ENH: make sure paths do not end in / before adding one
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 303bdee..6d95af8 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1540,7 +1540,14 @@ void SystemTools::AddTranslationPath(const char * a, const char * b) == kwsys_stl::string::npos ) { // Before inserting make sure path ends with '/' - path_a += '/'; path_b += '/'; + if(path_a.size() && path_a[path_a.size() -1] != '/') + { + path_a += '/'; + } + if(path_b.size() && path_b[path_b.size() -1] != '/') + { + path_b += '/'; + } if( !(path_a == path_b) ) { SystemTools::TranslationMap->insert( |