From b0d03c9953693137186dc17e20596752d1beb371 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 15 Aug 2010 00:01:07 -0400 Subject: [PATCH 1/6] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 55aa1c8ebc..f654dfafdd 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 14) +SET(KWSYS_DATE_STAMP_DAY 15) From 78474d9f24876a88972d06c92a96d600335e354a Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 16 Aug 2010 00:01:04 -0400 Subject: [PATCH 2/6] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index f654dfafdd..2f3c581544 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 15) +SET(KWSYS_DATE_STAMP_DAY 16) From 0a21abd690948b1b964cf6055534b24b7e1139f9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Aug 2010 09:04:13 -0400 Subject: [PATCH 3/6] KWSys: Fix SplitPath for leading '\' on Windows Windows paths may begin with a single backslash when the drive letter is omitted. Recognize this as a root path component. --- Source/kwsys/SystemTools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 3153235519..1f3b5af7c6 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3143,9 +3143,9 @@ const char* SystemTools::SplitPathRootComponent(const char* p, } c += 2; } - else if(c[0] == '/') + else if(c[0] == '/' || c[0] == '\\') { - // Unix path. + // Unix path (or Windows path w/out drive letter). if(root) { *root = "/"; From 0f5189d144df43b1fee80146522a4675162afae3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Aug 2010 09:58:20 -0400 Subject: [PATCH 4/6] KWSys: Fix GetActualCaseForPath for UNC paths See issue #11023. Author: Clinton Stimpson --- Source/kwsys/SystemTools.cxx | 97 +++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 1f3b5af7c6..bcdb193d15 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3059,39 +3059,45 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot static int GetCasePathName(const kwsys_stl::string & pathIn, kwsys_stl::string & casePath) { - kwsys_stl::string::size_type iFound = pathIn.rfind('/'); - if (iFound > 1 && iFound != pathIn.npos) + kwsys_stl::vector path_components = + SystemTools::SplitString(pathIn.c_str(), '/', true); + if(path_components.empty()) { - // recurse to peel off components - // - if (GetCasePathName(pathIn.substr(0, iFound), casePath) > 0) - { - casePath += '/'; - if (pathIn[1] != '/') - { - WIN32_FIND_DATA findData; - - // append the long component name to the path - // - HANDLE hFind = ::FindFirstFile(pathIn.c_str(), &findData); - if (INVALID_HANDLE_VALUE != hFind) - { - casePath += findData.cFileName; - ::FindClose(hFind); - } - else - { - // if FindFirstFile fails, return the error code - // - casePath = ""; - return 0; - } - } - } + casePath = ""; + return 0; } - else + kwsys_stl::vector::size_type idx = 0; + // assume always absolute path, so just take first + casePath = path_components[idx++]; + // If network path, fill casePath with server/share so FindFirstFile + // will work after that. Maybe someday call other APIs to get + // actual case of servers and shares. + if(path_components.size() > 2 && pathIn.size() >= 2 && + pathIn[0] == '/' && pathIn[1] == '/') { - casePath = pathIn; + casePath += path_components[idx++]; + casePath += "/"; + casePath += path_components[idx++]; + } + + for(; idx < path_components.size(); idx++) + { + casePath += "/"; + kwsys_stl::string test_str = casePath; + test_str += path_components[idx]; + + WIN32_FIND_DATA findData; + HANDLE hFind = ::FindFirstFile(test_str.c_str(), &findData); + if (INVALID_HANDLE_VALUE != hFind) + { + casePath += findData.cFileName; + ::FindClose(hFind); + } + else + { + casePath = ""; + return 0; + } } return (int)casePath.size(); } @@ -3104,28 +3110,29 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p) #ifndef _WIN32 return p; #else - // Check to see if actual case has already been called - // for this path, and the result is stored in the LongPathMap - SystemToolsTranslationMap::iterator i = - SystemTools::LongPathMap->find(p); - if(i != SystemTools::LongPathMap->end()) - { - return i->second; - } - kwsys_stl::string casePath; - int len = GetCasePathName(p, casePath); - if(len == 0 || len > MAX_PATH+1) - { - return p; - } + kwsys_stl::string casePath = p; // make sure drive letter is always upper case if(casePath.size() > 1 && casePath[1] == ':') { casePath[0] = toupper(casePath[0]); } + + // Check to see if actual case has already been called + // for this path, and the result is stored in the LongPathMap + SystemToolsTranslationMap::iterator i = + SystemTools::LongPathMap->find(casePath); + if(i != SystemTools::LongPathMap->end()) + { + return i->second; + } + int len = GetCasePathName(p, casePath); + if(len == 0 || len > MAX_PATH+1) + { + return p; + } (*SystemTools::LongPathMap)[p] = casePath; return casePath; -#endif +#endif } //---------------------------------------------------------------------------- From f4ce315301d3c09b3c8476d9bd6dcf1b38066ddb Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 17 Aug 2010 00:01:05 -0400 Subject: [PATCH 5/6] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 2f3c581544..7aee7793a1 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 16) +SET(KWSYS_DATE_STAMP_DAY 17) From c088e7a341e2af45ee343fcedefa32acdba14b2e Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Aug 2010 09:23:35 -0400 Subject: [PATCH 6/6] ModuleNoticesTest: Do not require "Kitware" copyright When a module is first contributed Kitware has made no modifications on which to place a copyright. Require the contributor to have a copyright notice, but not specifically by Kitware. --- Tests/CMakeTests/ModuleNoticesTest.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeTests/ModuleNoticesTest.cmake.in b/Tests/CMakeTests/ModuleNoticesTest.cmake.in index 9ad6cfb771..8ecebd338f 100644 --- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in +++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in @@ -3,7 +3,7 @@ # match any additional copyright holder notices. set(notice_regex " #============================================================================= -# Copyright (20[0-9][0-9]-)?20[0-9][0-9] Kitware[^\n]+( +# Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+( # Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+)* # # Distributed under the OSI-approved BSD License \\(the \"License\"\\);