summaryrefslogtreecommitdiff
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2010-11-22 14:56:55 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2010-11-22 15:12:47 -0500
commit6fe8624b7ff39f8511f4f4d7ebcbc5681932a6a5 (patch)
treed843ab5af124eda789e71867ac71b9a98882e0cd /Source/cmCacheManager.cxx
parent40b9336b3145634be03bfd296d76a774a8e11e17 (diff)
downloadcmake-6fe8624b7ff39f8511f4f4d7ebcbc5681932a6a5.tar.gz
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?
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 2aa623646b..fe6467a32b 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;