From 6fe8624b7ff39f8511f4f4d7ebcbc5681932a6a5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 22 Nov 2010 14:56:55 -0500 Subject: [PATCH] Fix parsing of cache variables without a type These mainly come from the command line or manual entries in the CMakeCache.txt file. We want to stop at the first '=' because this is what is most likely to have been meant. The variable can be quoted if the '=' is intended. Caveat: What if one wants both '"' and '=' in a variable name? --- Source/cmCacheManager.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 2aa623646..fe6467a32 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -97,10 +97,10 @@ bool cmCacheManager::ParseEntry(const char* entry, std::string& var, std::string& value) { - // input line is: key:type=value + // input line is: key=value static cmsys::RegularExpression reg( - "^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); - // input line is: "key":type=value + "^([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + // input line is: "key"=value static cmsys::RegularExpression regQuoted( "^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); bool flag = false;