- fix for: -D option can't use value with equals sign
[packages/cmake.git] / cmake-parse.patch
CommitLineData
6d0542bf
KK
1commit 6fe8624b7ff39f8511f4f4d7ebcbc5681932a6a5
2Author: Ben Boeckel <ben.boeckel@kitware.com>
3Date: Mon Nov 22 14:56:55 2010 -0500
4
5 Fix parsing of cache variables without a type
6
7 These mainly come from the command line or manual entries in the
8 CMakeCache.txt file. We want to stop at the first '=' because this is
9 what is most likely to have been meant. The variable can be quoted if
10 the '=' is intended.
11
12 Caveat: What if one wants both '"' and '=' in a variable name?
13
14diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
15index 2aa6236..fe6467a 100644
16--- a/Source/cmCacheManager.cxx
17+++ b/Source/cmCacheManager.cxx
18@@ -97,10 +97,10 @@ bool cmCacheManager::ParseEntry(const char* entry,
19 std::string& var,
20 std::string& value)
21 {
22- // input line is: key:type=value
23+ // input line is: key=value
24 static cmsys::RegularExpression reg(
25- "^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
26- // input line is: "key":type=value
27+ "^([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
28+ // input line is: "key"=value
29 static cmsys::RegularExpression regQuoted(
30 "^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
31 bool flag = false;
This page took 0.107898 seconds and 4 git commands to generate.