diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2001-12-05 20:29:36 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2001-12-05 20:29:36 (GMT) |
commit | ecca17cfdd016e4ff6ff577824e6f1f44f8027fc (patch) | |
tree | 5368f10794d7ea3a9047ea2c03c119d588b07271 /Source/MFCDialog/CMakeSetupDialog.cpp | |
parent | e273223d6d881b9f9a84243ce7dcef4bbeeeebee (diff) | |
download | CMake-ecca17cfdd016e4ff6ff577824e6f1f44f8027fc.zip CMake-ecca17cfdd016e4ff6ff577824e6f1f44f8027fc.tar.gz CMake-ecca17cfdd016e4ff6ff577824e6f1f44f8027fc.tar.bz2 |
Add single quotes feature.
Diffstat (limited to 'Source/MFCDialog/CMakeSetupDialog.cpp')
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 43484b4..36ca704 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -620,7 +620,17 @@ void CMakeSetupDialog::FillCacheGUIFromCacheManager() i != cache.end(); ++i) { const char* key = i->first.c_str(); - const cmCacheManager::CacheEntry& value = i->second; + cmCacheManager::CacheEntry value = i->second; + + // if value has trailing space or tab, enclose it in single quotes + // to enforce the fact that it has 'invisible' trailing stuff + if (value.m_Value.size() && + (value.m_Value[value.m_Value.size() - 1] == ' ' || + value.m_Value[value.m_Value.size() - 1] == '\t')) + { + value.m_Value = '\'' + value.m_Value + '\''; + } + if(!m_AdvancedValues) { std::string advancedVar = key; @@ -722,7 +732,20 @@ void CMakeSetupDialog::FillCacheManagerFromCacheGUI() (const char*)item->m_propName); if (entry) { - entry->m_Value = item->m_curValue; + // if value is enclosed in single quotes ('foo') then remove them + // they were used to enforce the fact that it had 'invisible' + // trailing stuff + if (item->m_curValue.GetLength() >= 2 && + item->m_curValue[0] == '\'' && + item->m_curValue[item->m_curValue.GetLength() - 1] == '\'') + { + entry->m_Value = item->m_curValue.Mid(1, + item->m_curValue.GetLength() - 2); + } + else + { + entry->m_Value = item->m_curValue; + } } } } |