diff options
author | Stephan Szabo <stephan.szabo@sony.com> | 2018-11-20 18:09:57 (GMT) |
---|---|---|
committer | Stephan Szabo <stephan.szabo@sony.com> | 2018-11-28 15:43:25 (GMT) |
commit | 8279302110ee6eb09a16e33b3bf8f8ad4ee13b73 (patch) | |
tree | 8d99ec1e7fac777833a6a4421e12728fe2a15586 /Source/cmIDEOptions.cxx | |
parent | 139b39985f26d4517072d49715c3dfd50a0d7001 (diff) | |
download | CMake-8279302110ee6eb09a16e33b3bf8f8ad4ee13b73.zip CMake-8279302110ee6eb09a16e33b3bf8f8ad4ee13b73.tar.gz CMake-8279302110ee6eb09a16e33b3bf8f8ad4ee13b73.tar.bz2 |
Convert cmIDEFlagTable to use owned strings
Convert from char* to std::string in flag tables.
Change termination condition from nullptr to empty string in command flag.
Update tables to store empty strings.
Diffstat (limited to 'Source/cmIDEOptions.cxx')
-rw-r--r-- | Source/cmIDEOptions.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index f996788..ee0c782 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -97,24 +97,24 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, { const char* pf = flag.c_str() + 1; // Look for an entry in the flag table matching this flag. - for (cmIDEFlagTable const* entry = table; entry->IDEName; ++entry) { + for (cmIDEFlagTable const* entry = table; !entry->IDEName.empty(); ++entry) { bool entry_found = false; if (entry->special & cmIDEFlagTable::UserValue) { // This flag table entry accepts a user-specified value. If // the entry specifies UserRequired we must match only if a // non-empty value is given. - int n = static_cast<int>(strlen(entry->commandFlag)); - if ((strncmp(pf, entry->commandFlag, n) == 0 || + int n = static_cast<int>(entry->commandFlag.length()); + if ((strncmp(pf, entry->commandFlag.c_str(), n) == 0 || (entry->special & cmIDEFlagTable::CaseInsensitive && - cmsysString_strncasecmp(pf, entry->commandFlag, n))) && + cmsysString_strncasecmp(pf, entry->commandFlag.c_str(), n))) && (!(entry->special & cmIDEFlagTable::UserRequired) || static_cast<int>(strlen(pf)) > n)) { this->FlagMapUpdate(entry, std::string(pf + n)); entry_found = true; } - } else if (strcmp(pf, entry->commandFlag) == 0 || + } else if (strcmp(pf, entry->commandFlag.c_str()) == 0 || (entry->special & cmIDEFlagTable::CaseInsensitive && - cmsysString_strcasecmp(pf, entry->commandFlag) == 0)) { + cmsysString_strcasecmp(pf, entry->commandFlag.c_str()) == 0)) { if (entry->special & cmIDEFlagTable::UserFollowing) { // This flag expects a value in the following argument. this->DoingFollowing = entry; |