diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-11-22 15:45:30 -0500 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-11-22 15:45:30 -0500 |
commit | 8b143fab66a2d1e93bf01eb7837a33e52644c396 (patch) | |
tree | b51ea8952d7e381dadaa849ef3669b1185dc9c14 /Source/cmCacheManager.cxx | |
parent | 122ebf12976ce370d78aa14594baf39f30b5c9ee (diff) | |
download | cmake-8b143fab66a2d1e93bf01eb7837a33e52644c396.tar.gz |
Condense parsing of cache entries
If a cache line is being parsed, it shouldn't matter whether it has a
type or not; just parse it however possible.
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r-- | Source/cmCacheManager.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index eabdf87ec7..2baacbf2eb 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -93,9 +93,9 @@ bool cmCacheManager::LoadCache(const char* path, return this->LoadCache(path, internal, emptySet, emptySet); } -bool cmCacheManager::ParseEntry(const char* entry, - std::string& var, - std::string& value) +static bool ParseEntryWithoutType(const char* entry, + std::string& var, + std::string& value) { // input line is: key=value static cmsys::RegularExpression reg( @@ -169,6 +169,11 @@ bool cmCacheManager::ParseEntry(const char* entry, value.size() - 2); } + if (!flag) + { + return ParseEntryWithoutType(entry, var, value); + } + return flag; } @@ -253,8 +258,7 @@ bool cmCacheManager::LoadCache(const char* path, } } e.SetProperty("HELPSTRING", helpString.c_str()); - if(cmCacheManager::ParseEntry(realbuffer, entryKey, e.Value, e.Type) || - cmCacheManager::ParseEntry(realbuffer, entryKey, e.Value)) + if(cmCacheManager::ParseEntry(realbuffer, entryKey, e.Value, e.Type)) { if ( excludes.find(entryKey) == excludes.end() ) { |