summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-27 08:51:01 -0400
committerBrad King <brad.king@kitware.com>2018-03-27 08:51:01 -0400
commit36881ee4169112147f0ce1e6422c879ced86fec2 (patch)
tree2f306c0d503eef4fe5df368d780062e7c5499231
parent188c5c2a46173b0bcff928098fb406ad925fb3db (diff)
parent27f033550a3693df67a30ce94f3c5e60a7a337ec (diff)
downloadcmake-36881ee4169112147f0ce1e6422c879ced86fec2.tar.gz
Merge branch 'ctest_update-memory-problems' into release-3.11
Merge-request: !1893
-rw-r--r--Source/CTest/cmCTestSVN.h4
-rw-r--r--Source/cmSystemTools.cxx13
2 files changed, 10 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index dbc7fdef64..a467ede28a 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -8,6 +8,7 @@
#include "cmCTestGlobalVC.h"
#include <iosfwd>
+#include <list>
#include <string>
#include <vector>
@@ -70,7 +71,8 @@ private:
friend struct Revision;
// Info of all the repositories (root, externals and nested ones).
- std::vector<SVNInfo> Repositories;
+ // Use std::list so the elements don't move in memory.
+ std::list<SVNInfo> Repositories;
// Pointer to the infos of the root repository.
SVNInfo* RootInfo;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 88cfe81d83..eeb73c3ee4 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -550,12 +550,13 @@ std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
bool win_path = false;
- if ((command[0] != '/' && command[1] == ':' && command[2] == '\\') ||
- (command[0] == '\"' && command[1] != '/' && command[2] == ':' &&
- command[3] == '\\') ||
- (command[0] == '\'' && command[1] != '/' && command[2] == ':' &&
- command[3] == '\\') ||
- (command[0] == '\\' && command[1] == '\\')) {
+ if (command[0] && command[1] &&
+ ((command[0] != '/' && command[1] == ':' && command[2] == '\\') ||
+ (command[0] == '\"' && command[1] != '/' && command[2] == ':' &&
+ command[3] == '\\') ||
+ (command[0] == '\'' && command[1] != '/' && command[2] == ':' &&
+ command[3] == '\\') ||
+ (command[0] == '\\' && command[1] == '\\'))) {
win_path = true;
}
// Split the command into an argv array.