mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-14 11:09:56 -06:00
KWSys 2013-07-10 (beef6819)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ beef6819 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' f6c4c247..beef6819
Brad King (1):
beef6819 SystemTools: Implement IsSubDirectory without loop
Change-Id: Ifab0c0384c7fbf1f9fc934918573a49b38f7bc0a
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user