mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-31 01:24:19 +02:00
parent
8d3632caf8
commit
6bf47fd221
@ -293,10 +293,15 @@ Filter::Ptr LivestatusQuery::ParseFilter(const String& params, unsigned long& fr
|
|||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
sp_index = temp_buffer.FindFirstOf(" ");
|
sp_index = temp_buffer.FindFirstOf(" ");
|
||||||
|
|
||||||
|
/* check if this is the last argument */
|
||||||
|
if (sp_index == String::NPos) {
|
||||||
/* 'attr op' or 'attr op val' is valid */
|
/* 'attr op' or 'attr op val' is valid */
|
||||||
if (i < 1 && sp_index == String::NPos)
|
if (i < 1)
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error("Livestatus filter '" + params + "' does not contain all required fields."));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Livestatus filter '" + params + "' does not contain all required fields."));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
tokens.push_back(temp_buffer.SubStr(0, sp_index));
|
tokens.push_back(temp_buffer.SubStr(0, sp_index));
|
||||||
temp_buffer = temp_buffer.SubStr(sp_index + 1);
|
temp_buffer = temp_buffer.SubStr(sp_index + 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user