[Cmake-commits] CMake branch, next, updated. v3.5.0-rc2-206-g5887e75
Brad King
brad.king at kitware.com
Thu Feb 18 10:30:02 EST 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 5887e756f47e5bf0ce6c4f077b4cbaec790c22b0 (commit)
via 845cd34bb887cf7ef1f31ff4fb7de32177f8ff3b (commit)
from 73fc30a40ee97ec975b07002648983fc27c94b5c (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=5887e756f47e5bf0ce6c4f077b4cbaec790c22b0
commit 5887e756f47e5bf0ce6c4f077b4cbaec790c22b0
Merge: 73fc30a 845cd34
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 18 10:30:02 2016 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 18 10:30:02 2016 -0500
Merge topic 'unix-timestamps' into next
845cd34b fixup! CMake: Extend TIMESTAMP sub-commands with new unix time format
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=845cd34bb887cf7ef1f31ff4fb7de32177f8ff3b
commit 845cd34bb887cf7ef1f31ff4fb7de32177f8ff3b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 18 10:27:09 2016 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 18 10:27:09 2016 -0500
fixup! CMake: Extend TIMESTAMP sub-commands with new unix time format
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 2cb3a15..1c795c4 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -106,25 +106,23 @@ time_t cmTimestamp::CreateUtcTimeTFromTm(struct tm &tm) const
#else
// From Linux timegm() manpage.
- const char * tz = cmSystemTools::GetEnv("TZ");
-
- if (tz)
+ std::string tz_old = "TZ=";
+ if (const char* tz = cmSystemTools::GetEnv("TZ"))
{
- tz = strdup(tz);
+ tz_old += tz;
}
// The standard says that "TZ=" or "TZ=[UNRECOGNIZED_TZ]" means UTC.
// It seems that "TZ=" does NOT work, at least under Windows
// with neither MSVC nor MinGW, so let's use explicit "TZ=UTC"
- cmSystemTools::PutEnv(std::string("TZ=UTC"));
+ cmSystemTools::PutEnv("TZ=UTC");
tzset();
time_t result = mktime(&tm);
- cmSystemTools::PutEnv(std::string("TZ=") +
- std::string(tz ? tz : ""));
+ cmSystemTools::PutEnv(tz_old);
tzset();
-----------------------------------------------------------------------
Summary of changes:
Source/cmTimestamp.cxx | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list