cmCacheManager: parse -D flags more strictly
In the case of: -DCACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG:BOOL=TRUE the variable is parsed out as: CACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG because the parser allows '=' in the variable name. Disallow such a name on the command line.
This commit is contained in:
parent
368e8de4cd
commit
aee7e4a03b
|
@ -139,7 +139,7 @@ bool cmCacheManager::ParseEntry(const std::string& entry,
|
||||||
{
|
{
|
||||||
// input line is: key:type=value
|
// input line is: key:type=value
|
||||||
static cmsys::RegularExpression reg(
|
static cmsys::RegularExpression reg(
|
||||||
"^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
"^([^=:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
||||||
// input line is: "key":type=value
|
// input line is: "key":type=value
|
||||||
static cmsys::RegularExpression regQuoted(
|
static cmsys::RegularExpression regQuoted(
|
||||||
"^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
"^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
^--><--$
|
^-->-DBAR:BOOL=BAZ<--$
|
||||||
|
|
Loading…
Reference in New Issue