[Cmake-commits] CMake branch, next, updated. v3.3.1-2836-g0c2bfcf
Brad King
brad.king at kitware.com
Thu Sep 10 10:06:43 EDT 2015
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 0c2bfcf32048db82050c15bed36cb0419799b9c1 (commit)
via 9c4a500f75e821ec6afb303a6ef5d951dcdc5c63 (commit)
via 87a9061d57d2838b3793644a051542e329d305fa (commit)
from 12eaeeb08d00f001b8471dc0f2fe011966c1e923 (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=0c2bfcf32048db82050c15bed36cb0419799b9c1
commit 0c2bfcf32048db82050c15bed36cb0419799b9c1
Merge: 12eaeeb 9c4a500
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 10 10:06:42 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Sep 10 10:06:42 2015 -0400
Merge topic 'fix-TrimWhitespace' into next
9c4a500f cmSystemTools: Fix TrimWhitespace for non-ascii strings (#15735)
87a9061d cmSystemTools: Factor out a cm_isspace helper
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c4a500f75e821ec6afb303a6ef5d951dcdc5c63
commit 9c4a500f75e821ec6afb303a6ef5d951dcdc5c63
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 10 10:05:21 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 10 10:05:21 2015 -0400
cmSystemTools: Fix TrimWhitespace for non-ascii strings (#15735)
Since commit v2.8.11~59^2 (cmSystemTools: Generalize TrimWhitespace to
all whitespace, 2013-03-27) we incorrectly use `c <= ' '` to determine
if `c` is a whitespace character. With a signed `char` type UTF-8
encoded strings may be truncated because values above 0x7f appear
negative and therefore less than 0x20. Use `isspace(c)` instead.
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 84a288c..005a803 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -233,13 +233,13 @@ std::string cmSystemTools::HelpFileName(std::string name)
std::string cmSystemTools::TrimWhitespace(const std::string& s)
{
std::string::const_iterator start = s.begin();
- while(start != s.end() && *start <= ' ')
+ while (start != s.end() && cm_isspace(*start))
++start;
if (start == s.end())
return "";
std::string::const_iterator stop = s.end()-1;
- while(*stop <= ' ')
+ while (cm_isspace(*stop))
--stop;
return std::string(start, stop+1);
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87a9061d57d2838b3793644a051542e329d305fa
commit 87a9061d57d2838b3793644a051542e329d305fa
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 10 10:04:20 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 10 10:04:20 2015 -0400
cmSystemTools: Factor out a cm_isspace helper
Extract the logic added by commit v3.1.0-rc1~386^2 (Encoding: Fix debug
asserts ... with non-ascii chars, 2014-06-16) into a helper function so
we can re-use it.
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b1b7f47..84a288c 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -68,6 +68,11 @@
# include "cmMachO.h"
#endif
+static bool cm_isspace(char c)
+{
+ return ((c & 0x80) == 0) && isspace(c);
+}
+
class cmSystemToolsFileTime
{
public:
@@ -496,7 +501,7 @@ void cmSystemTools::ParseWindowsCommandLine(const char* command,
{
arg.append(backslashes, '\\');
backslashes = 0;
- if(((*c & 0x80) == 0 ) && isspace(*c))
+ if (cm_isspace(*c))
{
if(in_quotes)
{
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list