Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2013-07-11 09:04:05 -04:00
commit 635e19d607
1 changed files with 4 additions and 8 deletions

View File

@ -4261,17 +4261,13 @@ bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir)
} }
kwsys_stl::string subdir = cSubdir; kwsys_stl::string subdir = cSubdir;
kwsys_stl::string dir = cDir; kwsys_stl::string dir = cDir;
SystemTools::ConvertToUnixSlashes(subdir);
SystemTools::ConvertToUnixSlashes(dir); SystemTools::ConvertToUnixSlashes(dir);
kwsys_stl::string path = subdir; if(subdir.size() > dir.size() && subdir[dir.size()] == '/')
do
{ {
path = SystemTools::GetParentDirectory(path.c_str()); std::string s = subdir.substr(0, dir.size());
if(SystemTools::ComparePath(dir.c_str(), path.c_str())) return SystemTools::ComparePath(s.c_str(), dir.c_str());
{
return true;
}
} }
while ( path.size() > dir.size() );
return false; return false;
} }