mirror of https://github.com/Icinga/icinga2.git
Fix problem with macro arguments which are not separated by whitespace
fixes #7314
This commit is contained in:
parent
2a41e0e18e
commit
a5c206cbe2
|
@ -239,8 +239,8 @@ Value MacroProcessor::InternalResolveMacros(const String& str, const ResolverLis
|
||||||
|
|
||||||
String resolved_macro_str = resolved_macro;
|
String resolved_macro_str = resolved_macro;
|
||||||
|
|
||||||
result.Replace(pos_first, pos_second - pos_first + 1, resolved_macro);
|
result.Replace(pos_first, pos_second - pos_first + 1, resolved_macro_str);
|
||||||
offset = pos_first + resolved_macro_str.GetLength() + 1;
|
offset = pos_first + resolved_macro_str.GetLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -46,6 +46,7 @@ BOOST_AUTO_TEST_CASE(simple)
|
||||||
|
|
||||||
BOOST_CHECK(MacroProcessor::ResolveMacros("$macrosA.testB$ $macrosB.testC$", resolvers) == "hello world");
|
BOOST_CHECK(MacroProcessor::ResolveMacros("$macrosA.testB$ $macrosB.testC$", resolvers) == "hello world");
|
||||||
BOOST_CHECK(MacroProcessor::ResolveMacros("$testA$", resolvers) == "7");
|
BOOST_CHECK(MacroProcessor::ResolveMacros("$testA$", resolvers) == "7");
|
||||||
|
BOOST_CHECK(MacroProcessor::ResolveMacros("$testA$$testB$", resolvers) == "7hello");
|
||||||
|
|
||||||
Array::Ptr result = MacroProcessor::ResolveMacros("$testD$", resolvers);
|
Array::Ptr result = MacroProcessor::ResolveMacros("$testD$", resolvers);
|
||||||
BOOST_CHECK(result->GetLength() == 2);
|
BOOST_CHECK(result->GetLength() == 2);
|
||||||
|
|
Loading…
Reference in New Issue