Fix setvar action to accept equals nothing

This commit is contained in:
Felipe Zimmerle 2016-06-23 15:48:23 -03:00
parent cf2ffe7e11
commit 0fdde52532
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -65,17 +65,16 @@ bool SetVar::init(std::string *error) {
m_variableName = std::string(m_parser_payload, pos + 1, m_variableName = std::string(m_parser_payload, pos + 1,
pos2 - (pos + 1)); pos2 - (pos + 1));
if (pos2 + 2 > m_parser_payload.length()) { if (pos2 + 2 > m_parser_payload.length()) {
error->assign("Something wrong with the input format"); m_predicate = "";
return false;
}
if (m_operation == setOperation) {
m_predicate = std::string(m_parser_payload, pos2 + 1,
m_parser_payload.length() - (pos2));
} else { } else {
m_predicate = std::string(m_parser_payload, pos2 + 2, if (m_operation == setOperation) {
m_parser_payload.length() m_predicate = std::string(m_parser_payload, pos2 + 1,
- (pos2 + 1)); m_parser_payload.length() - (pos2));
} else {
m_predicate = std::string(m_parser_payload, pos2 + 2,
m_parser_payload.length()
- (pos2 + 1));
}
} }
} }