diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-07-21 19:29:29 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-07-21 19:29:29 (GMT) |
commit | 2d513c2364fde09919526257929b794cfff6e08f (patch) | |
tree | 49f6c598ccb6325e8848dc76866ec742abd5ddfe /Source/cmGlob.cxx | |
parent | d4042b46d1f6c41aeaf3ed88ef0e74f2b22b43ab (diff) | |
download | CMake-2d513c2364fde09919526257929b794cfff6e08f.zip CMake-2d513c2364fde09919526257929b794cfff6e08f.tar.gz CMake-2d513c2364fde09919526257929b794cfff6e08f.tar.bz2 |
ENH: fix glob on windows and add glob recurse test
Diffstat (limited to 'Source/cmGlob.cxx')
-rw-r--r-- | Source/cmGlob.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/cmGlob.cxx b/Source/cmGlob.cxx index 136673f..466f9c6 100644 --- a/Source/cmGlob.cxx +++ b/Source/cmGlob.cxx @@ -205,6 +205,7 @@ void cmGlob::ProcessDirectory(std::string::size_type start, { continue; } + if ( m_Internals->Expressions[start].find(d.GetFile(cc)) ) { if ( last ) @@ -233,6 +234,10 @@ bool cmGlob::FindFiles(const std::string& inexpr) expr = cmsys::SystemTools::GetCurrentWorkingDirectory(); expr += "/" + inexpr; } + if ( expr[1] == ':' && expr[0] != '/' ) + { + expr = expr.substr(2); + } for ( cc = 0; cc < expr.size(); cc ++ ) { int ch = expr[cc]; @@ -253,8 +258,24 @@ bool cmGlob::FindFiles(const std::string& inexpr) { this->AddExpression(cexpr.c_str()); } - - this->ProcessDirectory(0, "/", true); + if ( inexpr[1] == ':' && inexpr[0] != '/' ) + { + std::string startdir = "A:/"; + if ( inexpr[0] >= 'a' && inexpr[0] <= 'z' || + inexpr[0] >= 'A' && inexpr[0] <= 'Z') + { + startdir[0] = inexpr[0]; + this->ProcessDirectory(0, startdir, true); + } + else + { + return false; + } + } + else + { + this->ProcessDirectory(0, "/", true); + } return true; } |