[Cmake-commits] CMake branch, next, updated. v3.2.2-2478-gae9e9fc

Stephen Kelly steveire at gmail.com
Mon May 4 16:32:05 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  ae9e9fcf50eb6a3731f0edda1c1ee7ea3b719cfd (commit)
       via  9945469c38ee662f6106861f3cb6d37c78b40ccc (commit)
      from  a7850c5498db008be536da8cddb72724743f9011 (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=ae9e9fcf50eb6a3731f0edda1c1ee7ea3b719cfd
commit ae9e9fcf50eb6a3731f0edda1c1ee7ea3b719cfd
Merge: a7850c5 9945469
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 16:32:05 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon May 4 16:32:05 2015 -0400

    Merge topic 'refactor-cmPolicies' into next
    
    9945469c fixup! cmPolicies: Parse string for id conversion.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9945469c38ee662f6106861f3cb6d37c78b40ccc
commit 9945469c38ee662f6106861f3cb6d37c78b40ccc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 22:27:43 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon May 4 22:29:06 2015 +0200

    fixup! cmPolicies: Parse string for id conversion.

diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 31ab4dc..f8d61db 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -16,18 +16,33 @@ static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
     {
     return false;
     }
-  if (cmHasLiteralPrefix(input, "CMP0000"))
+  if (!cmHasLiteralPrefix(input, "CMP"))
+    {
+    return false;
+    }
+  if (cmHasLiteralSuffix(input, "0000"))
     {
     pid = cmPolicies::CMP0000;
     return true;
     }
-  long id = strtol(input + 3, (char **)0, 10);
-  if (id != 0)
+  for (int i = 3; i < 7; ++i)
     {
-    pid = cmPolicies::PolicyID(id);
-    return true;
+    if (!isdigit(*(input + i)))
+      {
+      return false;
+      }
     }
-  return false;
+  long id;
+  if (!cmSystemTools::StringToLong(input + 3, &id))
+    {
+    return false;
+    }
+  if (id >= cmPolicies::CMPCOUNT)
+    {
+    return false;
+    }
+  pid = cmPolicies::PolicyID(id);
+  return true;
 }
 
 #define CM_SELECT_ID_VERSION(F, A1, A2, A3, A4, A5, A6) F(A1, A3, A4, A5)

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

Summary of changes:
 Source/cmPolicies.cxx |   27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list