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:
Ben Boeckel 2014-10-20 12:17:19 -04:00
parent 368e8de4cd
commit aee7e4a03b
2 changed files with 2 additions and 2 deletions

View File

@ -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 ]*$");

View File

@ -1 +1 @@
^--><--$
^-->-DBAR:BOOL=BAZ<--$