diff options
author | Brad King <brad.king@kitware.com> | 2013-07-11 13:04:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-11 13:04:05 (GMT) |
commit | 635e19d6077b8cbe6e657fb8bcc33a640c03bff6 (patch) | |
tree | 6c1923f66b7596f7c4224304a61ee24017f128ee /Source/kwsys | |
parent | 4dc515f8e16f0a924fb7f941c1cfe704dea9e785 (diff) | |
parent | 0a44fa4c6c87c76d2adfa1edf68b9f2cfe2096cb (diff) | |
download | CMake-635e19d6077b8cbe6e657fb8bcc33a640c03bff6.zip CMake-635e19d6077b8cbe6e657fb8bcc33a640c03bff6.tar.gz CMake-635e19d6077b8cbe6e657fb8bcc33a640c03bff6.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 4d5af5e..935b836 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -4261,17 +4261,13 @@ bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir) } kwsys_stl::string subdir = cSubdir; kwsys_stl::string dir = cDir; + SystemTools::ConvertToUnixSlashes(subdir); SystemTools::ConvertToUnixSlashes(dir); - kwsys_stl::string path = subdir; - do + if(subdir.size() > dir.size() && subdir[dir.size()] == '/') { - path = SystemTools::GetParentDirectory(path.c_str()); - if(SystemTools::ComparePath(dir.c_str(), path.c_str())) - { - return true; - } + std::string s = subdir.substr(0, dir.size()); + return SystemTools::ComparePath(s.c_str(), dir.c_str()); } - while ( path.size() > dir.size() ); return false; } |