mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
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:
@@ -139,7 +139,7 @@ bool cmCacheManager::ParseEntry(const std::string& entry,
|
||||
{
|
||||
// input line is: key:type=value
|
||||
static cmsys::RegularExpression reg(
|
||||
"^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
||||
"^([^=:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
||||
// input line is: "key":type=value
|
||||
static cmsys::RegularExpression regQuoted(
|
||||
"^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
|
||||
|
@@ -1 +1 @@
|
||||
^--><--$
|
||||
^-->-DBAR:BOOL=BAZ<--$
|
||||
|
Reference in New Issue
Block a user