Fixed error when a self-referencing closing bracket was omitted from the IfCondition

This commit is contained in:
Brian Ferguson 2013-11-05 10:41:33 -07:00
parent 521861a87d
commit cf86d365ad

View File

@ -251,10 +251,19 @@ bool IfActions::ReplaceSelf(std::wstring& condition, const WCHAR* section,
while ((pos = condition.find(measureName, pos)) != std::wstring::npos)
{
condition.replace(pos, 1, eBracket.substr(0, 1));
pos = condition.find(sBracket[1], pos);
condition.replace(pos, 1, eBracket.substr(1, 1));
++pos;
replaced = true;
pos = condition.find(sBracket.substr(1, 1), pos);
if (pos != std::wstring::npos)
{
condition.replace(pos, 1, eBracket.substr(1, 1));
++pos;
replaced = true;
}
else
{
replaced = false; // No closing bracket found
break;
}
}
return replaced;