summaryrefslogtreecommitdiffstats
path: root/Source/cmGlob.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 19:29:29 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 19:29:29 (GMT)
commit2d513c2364fde09919526257929b794cfff6e08f (patch)
tree49f6c598ccb6325e8848dc76866ec742abd5ddfe /Source/cmGlob.cxx
parentd4042b46d1f6c41aeaf3ed88ef0e74f2b22b43ab (diff)
downloadCMake-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.cxx25
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;
}