summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-15 13:33:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-15 13:33:53 (GMT)
commit0e294b6fa75e022083467ce9b2a0a1ffea5575a7 (patch)
treea06fcada7bd2dfa26e5f3967669ae68165776591
parentfa6106ec56305b72017fff3d57836cc7319c8d48 (diff)
parent635e19d6077b8cbe6e657fb8bcc33a640c03bff6 (diff)
downloadCMake-0e294b6fa75e022083467ce9b2a0a1ffea5575a7.zip
CMake-0e294b6fa75e022083467ce9b2a0a1ffea5575a7.tar.gz
CMake-0e294b6fa75e022083467ce9b2a0a1ffea5575a7.tar.bz2
Merge topic 'update-kwsys'
635e19d Merge branch 'upstream-kwsys' into update-kwsys 0a44fa4 KWSys 2013-07-10 (beef6819)
-rw-r--r--Source/kwsys/SystemTools.cxx12
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;
}