Fix problem with macro arguments which are not separated by whitespace

fixes #7314
This commit is contained in:
Gunnar Beutner 2014-12-01 15:53:23 +01:00
parent 2a41e0e18e
commit a5c206cbe2
2 changed files with 3 additions and 2 deletions

View File

@ -239,8 +239,8 @@ Value MacroProcessor::InternalResolveMacros(const String& str, const ResolverLis
String resolved_macro_str = resolved_macro;
result.Replace(pos_first, pos_second - pos_first + 1, resolved_macro);
offset = pos_first + resolved_macro_str.GetLength() + 1;
result.Replace(pos_first, pos_second - pos_first + 1, resolved_macro_str);
offset = pos_first + resolved_macro_str.GetLength();
}
return result;

View File

@ -46,6 +46,7 @@ BOOST_AUTO_TEST_CASE(simple)
BOOST_CHECK(MacroProcessor::ResolveMacros("$macrosA.testB$ $macrosB.testC$", resolvers) == "hello world");
BOOST_CHECK(MacroProcessor::ResolveMacros("$testA$", resolvers) == "7");
BOOST_CHECK(MacroProcessor::ResolveMacros("$testA$$testB$", resolvers) == "7hello");
Array::Ptr result = MacroProcessor::ResolveMacros("$testD$", resolvers);
BOOST_CHECK(result->GetLength() == 2);