This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  026e51ac00810d47a1639b4380e27edccfd5cf25 (commit)
       via  7378792b4938d32c5eefc5bb485ecae1a7ec95fb (commit)
       via  4ab10e063d8f640d9a3fa029fe9993e94f4096c3 (commit)
       via  045d6ae0b042d4e6e3c4540c32559c58cb4153b0 (commit)
      from  7f692b1ddb83ae7ab67d48a1718aeb3e033408b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=026e51ac00810d47a1639b4380e27edccfd5cf25
commit 026e51ac00810d47a1639b4380e27edccfd5cf25
Merge: 7f692b1 7378792
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed May 29 08:59:33 2013 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed May 29 08:59:33 2013 -0400

    Merge topic 'fix-FileIsDirectory-SEGV' into next
    
    7378792 if: Add test for IS_DIRECTORY
    4ab10e0 Merge branch 'master' into fix-FileIsDirectory-SEGV
    045d6ae KWSys: Fix SystemTools::FileIsDirectory with long paths (#14176)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7378792b4938d32c5eefc5bb485ecae1a7ec95fb
commit 7378792b4938d32c5eefc5bb485ecae1a7ec95fb
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue May 28 11:13:24 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue May 28 11:35:32 2013 -0400

    if: Add test for IS_DIRECTORY
    
    Add a RunCMake.if test to cover if() command behavior.  Start with a
    test for IS_DIRECTORY cases with an existing directory and a long path,
    both with a trailing slash.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f676107..a0168a6 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -72,6 +72,7 @@ add_RunCMake_test(add_dependencies)
 add_RunCMake_test(build_command)
 add_RunCMake_test(find_package)
 add_RunCMake_test(get_filename_component)
+add_RunCMake_test(if)
 add_RunCMake_test(include)
 add_RunCMake_test(include_directories)
 add_RunCMake_test(list)
diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/if/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/if/IsDirectory-stdout.txt 
b/Tests/RunCMake/if/IsDirectory-stdout.txt
new file mode 100644
index 0000000..b89446a
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectory-stdout.txt
@@ -0,0 +1 @@
+CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash
diff --git a/Tests/RunCMake/if/IsDirectory.cmake 
b/Tests/RunCMake/if/IsDirectory.cmake
new file mode 100644
index 0000000..23d126d
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectory.cmake
@@ -0,0 +1,5 @@
+if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/")
+  message(STATUS "CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash")
+else()
+  message(FATAL_ERROR "CMAKE_CURRENT_SOURCE_DIR does not exist!")
+endif()
diff --git a/Tests/RunCMake/if/IsDirectoryLong-stdout.txt 
b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt
new file mode 100644
index 0000000..5e62754
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt
@@ -0,0 +1 @@
+Directory path with length 94208 correctly does not exist.
diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake 
b/Tests/RunCMake/if/IsDirectoryLong.cmake
new file mode 100644
index 0000000..0e93be7
--- /dev/null
+++ b/Tests/RunCMake/if/IsDirectoryLong.cmake
@@ -0,0 +1,10 @@
+set(d "/long/path/to/directory")
+foreach(i RANGE 11)
+  set(d "${d}${d}")
+endforeach()
+string(LENGTH "${d}" dl)
+if(IS_DIRECTORY "${d}/")
+  message(FATAL_ERROR "Directory should not exist!")
+else()
+  message(STATUS "Directory path with length ${dl} correctly does not exist.")
+endif()
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake 
b/Tests/RunCMake/if/RunCMakeTest.cmake
new file mode 100644
index 0000000..6b6b74b
--- /dev/null
+++ b/Tests/RunCMake/if/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(IsDirectory)
+run_cmake(IsDirectoryLong)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ab10e063d8f640d9a3fa029fe9993e94f4096c3
commit 4ab10e063d8f640d9a3fa029fe9993e94f4096c3
Merge: 045d6ae 07afd4f
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue May 28 11:34:28 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue May 28 11:34:50 2013 -0400

    Merge branch 'master' into fix-FileIsDirectory-SEGV
    
    Resolve conflict in Source/kwsys/SystemTools.cxx by combining the two
    changes.

diff --cc Source/kwsys/SystemTools.cxx
index 8b25d60,394d65e..158217e
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@@ -2741,24 -2741,15 +2741,24 @@@ bool SystemTools::FileIsDirectory(cons
      return false;
      }
  
-   // Remove any trailing slash from the name.
+   // Remove any trailing slash from the name except in a root component.
 -  char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
 +  char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
 +  std::string string_buffer;
    size_t last = length-1;
    if(last > 0 && (name[last] == '/' || name[last] == '\\')
-     && strcmp(name, "/") !=0)
+     && strcmp(name, "/") !=0 && name[last-1] != ':')
      {
 -    memcpy(buffer, name, last);
 -    buffer[last] = 0;
 -    name = buffer;
 +    if(last < sizeof(local_buffer))
 +      {
 +      memcpy(local_buffer, name, last);
 +      local_buffer[last] = 0;
 +      name = local_buffer;
 +      }
 +    else
 +      {
 +      string_buffer.append(name, last);
 +      name = string_buffer.c_str();
 +      }
      }
  
    // Now check the file node type.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=045d6ae0b042d4e6e3c4540c32559c58cb4153b0
commit 045d6ae0b042d4e6e3c4540c32559c58cb4153b0
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue May 28 11:12:18 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue May 28 11:27:05 2013 -0400

    KWSys: Fix SystemTools::FileIsDirectory with long paths (#14176)
    
    Allocate a buffer large enough to hold the input path when removing a
    trailing slash.  Use a local stack buffer when it is large enough and
    fall back to heap allocation otherwise.

diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 22bf193..8b25d60 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2742,14 +2742,23 @@ bool SystemTools::FileIsDirectory(const char* name)
     }
 
   // Remove any trailing slash from the name.
-  char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
+  char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
+  std::string string_buffer;
   size_t last = length-1;
   if(last > 0 && (name[last] == '/' || name[last] == '\\')
     && strcmp(name, "/") !=0)
     {
-    memcpy(buffer, name, last);
-    buffer[last] = 0;
-    name = buffer;
+    if(last < sizeof(local_buffer))
+      {
+      memcpy(local_buffer, name, last);
+      local_buffer[last] = 0;
+      name = local_buffer;
+      }
+    else
+      {
+      string_buffer.append(name, last);
+      name = string_buffer.c_str();
+      }
     }
 
   // Now check the file node type.

-----------------------------------------------------------------------

Summary of changes:
 Tests/RunCMake/CMakeLists.txt                 |    1 +
 Tests/RunCMake/{CMP0004 => if}/CMakeLists.txt |    0
 Tests/RunCMake/if/IsDirectory-stdout.txt      |    1 +
 Tests/RunCMake/if/IsDirectory.cmake           |    5 +++++
 Tests/RunCMake/if/IsDirectoryLong-stdout.txt  |    1 +
 Tests/RunCMake/if/IsDirectoryLong.cmake       |   10 ++++++++++
 Tests/RunCMake/if/RunCMakeTest.cmake          |    4 ++++
 7 files changed, 22 insertions(+), 0 deletions(-)
 copy Tests/RunCMake/{CMP0004 => if}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/if/IsDirectory-stdout.txt
 create mode 100644 Tests/RunCMake/if/IsDirectory.cmake
 create mode 100644 Tests/RunCMake/if/IsDirectoryLong-stdout.txt
 create mode 100644 Tests/RunCMake/if/IsDirectoryLong.cmake
 create mode 100644 Tests/RunCMake/if/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to