diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-06 20:26:15 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-06 20:26:15 (GMT) |
commit | 31c1071ebfb559ba4d0cd113e54f85d9e2228d77 (patch) | |
tree | bd00b78f5e1dbda7c87240af64127c87b01dbb81 /Source | |
parent | 9c744cfe35060d5d389b5d37d8d48ecf68a3b93f (diff) | |
download | CMake-31c1071ebfb559ba4d0cd113e54f85d9e2228d77.zip CMake-31c1071ebfb559ba4d0cd113e54f85d9e2228d77.tar.gz CMake-31c1071ebfb559ba4d0cd113e54f85d9e2228d77.tar.bz2 |
ENH: When nor specifying full path, make sure it actually works, on broken filesystems fix case of files.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlob.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmGlob.cxx b/Source/cmGlob.cxx index 20db17e..8454384 100644 --- a/Source/cmGlob.cxx +++ b/Source/cmGlob.cxx @@ -163,6 +163,7 @@ void cmGlob::RecurseDirectory(const std::string& dir, bool dir_only) } unsigned long cc; std::string fullname; + std::string realname; std::string fname; for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ ) { @@ -173,6 +174,8 @@ void cmGlob::RecurseDirectory(const std::string& dir, bool dir_only) continue; } + realname = dir + "/" + fname; + #if defined( CM_GLOB_CASE_INDEPENDENT ) // On Windows and apple, no difference between lower and upper case fname = cmsys::SystemTools::LowerCase(fname); @@ -210,6 +213,7 @@ void cmGlob::ProcessDirectory(std::string::size_type start, } unsigned long cc; std::string fullname; + std::string realname; std::string fname; for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ ) { @@ -220,6 +224,15 @@ void cmGlob::ProcessDirectory(std::string::size_type start, continue; } + if ( start == 0 ) + { + realname = dir + fname; + } + else + { + realname = dir + "/" + fname; + } + #if defined( CM_GLOB_CASE_INDEPENDENT ) // On Windows and apple, no difference between lower and upper case fname = cmsys::SystemTools::LowerCase(fname); @@ -247,11 +260,11 @@ void cmGlob::ProcessDirectory(std::string::size_type start, { if ( last ) { - m_Internals->Files.push_back(fullname); + m_Internals->Files.push_back(realname); } else { - this->ProcessDirectory(start+1, fullname + "/", dir_only); + this->ProcessDirectory(start+1, realname + "/", dir_only); } } } @@ -271,6 +284,7 @@ bool cmGlob::FindFiles(const std::string& inexpr) expr = cmsys::SystemTools::GetCurrentWorkingDirectory(); expr += "/" + inexpr; } + std::string fexpr = expr; int skip = 0; int last_slash = 0; @@ -289,7 +303,7 @@ bool cmGlob::FindFiles(const std::string& inexpr) } if ( last_slash > 0 ) { - //std::cout << "I can skip: " << inexpr.substr(0, last_slash) << std::endl; + //std::cout << "I can skip: " << fexpr.substr(0, last_slash) << std::endl; skip = last_slash; } if ( skip == 0 ) @@ -351,7 +365,7 @@ bool cmGlob::FindFiles(const std::string& inexpr) // Handle network paths if ( skip > 0 ) { - this->ProcessDirectory(0, inexpr.substr(0, skip) + "/", + this->ProcessDirectory(0, fexpr.substr(0, skip) + "/", true); } else |