Index: src/libchengine/ConfigNodeContainer.cpp =================================================================== diff -u -N -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r782902eb6d63ccceb0c1f3808403a23b8372d66f --- src/libchengine/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 782902eb6d63ccceb0c1f3808403a23b8372d66f) @@ -285,7 +285,6 @@ { bool bFound = false; TString strReplace(pszNode); - strReplace += _T("["); boost::shared_lock lock(m_lock); @@ -300,13 +299,23 @@ TString strName = iter->m_strNodeName.Get(); strName.MidSelf(strReplace.GetLength()); - size_t stPos = strName.Find(_T("]")); - if (stPos == std::numeric_limits::max()) - throw TCoreException(eErr_InvalidData, L"] character not found", LOCATION); - if (strName.GetAt(stPos + 1) != _T('.')) - throw TCoreException(eErr_InvalidData, L". character not found", LOCATION); - size_t stNodeIndex = boost::lexical_cast(strName.Left(stPos)); + size_t stNodeIndex = 0; + if (strName.StartsWith(L"[")) + { + size_t stPos = strName.Find(_T("]")); + if (stPos == std::numeric_limits::max()) + throw TCoreException(eErr_InvalidData, L"] character not found", LOCATION); + if (strName.GetAt(stPos + 1) != _T('.')) + throw TCoreException(eErr_InvalidData, L". character not found", LOCATION); + + stNodeIndex = boost::lexical_cast(strName.Mid(1, stPos - 1)); + + strName.Delete(0, stPos + 2); // skip "]." at the beginning + } + else + strName.Delete(0, 1); // skip "." at the beginning + if (stNodeIndex != stLastIndex) { tNewContainers.push_back(ConfigNodeContainer()); @@ -315,7 +324,6 @@ stLastIndex = stNodeIndex; } - strName.Delete(0, stPos + 2); // skip "]." at the beginning if (!pCurrentContainer) throw TCoreException(eErr_InvalidPointer, L"pCurrentContainer", LOCATION);