[Cmake-commits] CMake branch, next, updated. v3.6.0-905-g5a25a64
Brad King
brad.king at kitware.com
Tue Jul 19 10:18:50 EDT 2016
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 5a25a64ed408bfdeb7a3b4932188415f93f3580e (commit)
via 788bb146643030ebed27db297af83fe15b1f5447 (commit)
via eb7b5087f79527242a25c449c6ae837dcb4768ff (commit)
from 6a43e55d6d563ec65fe1ba8a4aa83c0f187be6b2 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a25a64ed408bfdeb7a3b4932188415f93f3580e
commit 5a25a64ed408bfdeb7a3b4932188415f93f3580e
Merge: 6a43e55 788bb14
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 19 10:18:49 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 19 10:18:49 2016 -0400
Merge topic 'update-kwsys' into next
788bb146 Merge branch 'upstream-KWSys' into update-kwsys
eb7b5087 KWSys 2016-07-18 (19732229)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=788bb146643030ebed27db297af83fe15b1f5447
commit 788bb146643030ebed27db297af83fe15b1f5447
Merge: 3421602 eb7b508
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 19 08:27:19 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 19 08:27:19 2016 -0400
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2016-07-18 (19732229)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb7b5087f79527242a25c449c6ae837dcb4768ff
commit eb7b5087f79527242a25c449c6ae837dcb4768ff
Author: KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Mon Jul 18 09:38:57 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 19 08:27:09 2016 -0400
KWSys 2016-07-18 (19732229)
Code extracted from:
http://public.kitware.com/KWSys.git
at commit 19732229f798419307782ea7d252b78701911ea3 (master).
Upstream Shortlog
-----------------
Dāvis Mosāns (1):
19732229 SystemTools: User better GetEnv and HasEnv signatures
diff --git a/SystemTools.cxx b/SystemTools.cxx
index f8ea884..0526372 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -490,14 +490,12 @@ void SystemTools::GetPath(std::vector<std::string>& path, const char* env)
{
env = "PATH";
}
- const char* cpathEnv = SystemTools::GetEnv(env);
- if ( !cpathEnv )
+ std::string pathEnv;
+ if ( !SystemTools::GetEnv(env, pathEnv) )
{
return;
}
- std::string pathEnv = cpathEnv;
-
// A hack to make the below algorithm work.
if(!pathEnv.empty() && *pathEnv.rbegin() != pathSep)
{
@@ -2132,8 +2130,8 @@ void SystemTools::ConvertToUnixSlashes(std::string& path)
pathCString = path.c_str();
if(pathCString[0] == '~' && (pathCString[1] == '/' || pathCString[1] == '\0'))
{
- const char* homeEnv = SystemTools::GetEnv("HOME");
- if (homeEnv)
+ std::string homeEnv;
+ if (SystemTools::GetEnv("HOME", homeEnv))
{
path.replace(0,1,homeEnv);
}
@@ -4149,16 +4147,9 @@ void SystemTools::SplitPath(const std::string& p,
if(root.size() == 1)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- if(const char* userp = getenv("USERPROFILE"))
- {
- homedir = userp;
- }
- else
+ if (!SystemTools::GetEnv("USERPROFILE", homedir))
#endif
- if(const char* h = getenv("HOME"))
- {
- homedir = h;
- }
+ SystemTools::GetEnv("HOME", homedir);
}
#ifdef HAVE_GETPWNAM
else if(passwd* pw = getpwnam(root.c_str()+1))
@@ -4899,7 +4890,7 @@ int SystemTools::GetTerminalWidth()
int width = -1;
#ifdef HAVE_TTY_INFO
struct winsize ws;
- char *columns; /* Unix98 environment variable */
+ std::string columns; /* Unix98 environment variable */
if(ioctl(1, TIOCGWINSZ, &ws) != -1 && ws.ws_col>0 && ws.ws_row>0)
{
width = ws.ws_col;
@@ -4908,12 +4899,11 @@ int SystemTools::GetTerminalWidth()
{
width = -1;
}
- columns = getenv("COLUMNS");
- if(columns && *columns)
+ if(SystemTools::GetEnv("COLUMNS", columns) && !columns.empty())
{
long t;
char *endptr;
- t = strtol(columns, &endptr, 0);
+ t = strtol(columns.c_str(), &endptr, 0);
if(endptr && !*endptr && (t>0) && (t<1000))
{
width = static_cast<int>(t);
@@ -5525,7 +5515,8 @@ void SystemTools::ClassInitialize()
// If the current working directory is a logical path then keep the
// logical name.
- if(const char* pwd = getenv("PWD"))
+ std::string pwd_str;
+ if(SystemTools::GetEnv("PWD", pwd_str))
{
char buf[2048];
if(const char* cwd = Getcwd(buf, 2048))
@@ -5537,10 +5528,9 @@ void SystemTools::ClassInitialize()
std::string pwd_changed;
// Test progressively shorter logical-to-physical mappings.
- std::string pwd_str = pwd;
std::string cwd_str = cwd;
std::string pwd_path;
- Realpath(pwd, pwd_path);
+ Realpath(pwd_str.c_str(), pwd_path);
while(cwd_str == pwd_path && cwd_str != pwd_str)
{
// The current pair of paths is a working logical mapping.
@@ -5596,8 +5586,8 @@ static int SystemToolsDebugReport(int, char* message, int*)
void SystemTools::EnableMSVCDebugHook()
{
- if (getenv("DART_TEST_FROM_DART") ||
- getenv("DASHBOARD_TEST_FROM_CTEST"))
+ if (SystemTools::HasEnv("DART_TEST_FROM_DART") ||
+ SystemTools::HasEnv("DASHBOARD_TEST_FROM_CTEST"))
{
_CrtSetReportHook(SystemToolsDebugReport);
}
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 4d97688..4dab347 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -848,9 +848,9 @@ static bool CheckPutEnv(const std::string& env, const char* name, const char* va
<< "\") failed!" << std::endl;
return false;
}
- const char* v = kwsys::SystemTools::GetEnv(name);
- v = v? v : "(null)";
- if(strcmp(v, value) != 0)
+ std::string v = "(null)";
+ kwsys::SystemTools::GetEnv(name, v);
+ if(v != value)
{
std::cerr << "GetEnv(\"" << name << "\") returned \""
<< v << "\", not \"" << value << "\"!" << std::endl;
@@ -867,7 +867,8 @@ static bool CheckUnPutEnv(const char* env, const char* name)
<< std::endl;
return false;
}
- if(const char* v = kwsys::SystemTools::GetEnv(name))
+ std::string v;
+ if(kwsys::SystemTools::GetEnv(name, v))
{
std::cerr << "GetEnv(\"" << name << "\") returned \""
<< v << "\", not (null)!" << std::endl;
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/SystemTools.cxx | 38 ++++++++++++++------------------------
Source/kwsys/testSystemTools.cxx | 9 +++++----
2 files changed, 19 insertions(+), 28 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list