Fix parsing performance data labels which contain '='

fixes #10254
This commit is contained in:
Gunnar Beutner 2015-10-13 09:38:31 +02:00
parent ac11653bbe
commit d741ca6c74
2 changed files with 11 additions and 1 deletions

View File

@ -192,6 +192,16 @@ public:
return m_Data.find_first_not_of(ch, pos);
}
inline SizeType FindLastOf(const char *s, SizeType pos = NPos) const
{
return m_Data.find_last_of(s, pos);
}
inline SizeType FindLastOf(char ch, SizeType pos = NPos) const
{
return m_Data.find_last_of(ch, pos);
}
inline String SubStr(SizeType first, SizeType len = NPos) const
{
return m_Data.substr(first, len);

View File

@ -50,7 +50,7 @@ PerfdataValue::PerfdataValue(String label, double value, bool counter,
PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
{
size_t eqp = perfdata.FindFirstOf('=');
size_t eqp = perfdata.FindLastOf('=');
if (eqp == String::NPos)
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid performance data value: " + perfdata));