Merge topic 'update-kwsys'
635e19d
Merge branch 'upstream-kwsys' into update-kwsys0a44fa4
KWSys 2013-07-10 (beef6819)
This commit is contained in:
commit
0e294b6fa7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue