Remove false matches while matching whole string

This commit is contained in:
Malin Ejdbo
2021-02-12 16:53:04 +01:00
parent 5772fc621c
commit f34805beeb

View File

@@ -120,6 +120,10 @@ void applyRegularExpression(lua_State* L, const std::string& regex,
else if (!nodeName.empty() && id.find(nodeName) == std::string::npos) {
continue;
}
// Match entire string
else if (id != propertyName) {
continue;
}
if (type != prop->typeLua()) {
LERRORC(
@@ -490,6 +494,10 @@ int property_getProperty(lua_State* L) {
else if (!nodeName.empty() && id.find(nodeName) == std::string::npos){
continue;
}
// Match entire string
else if (id != propertyName) {
continue;
}
res.push_back(id);
}
@@ -646,6 +654,10 @@ int removeSceneGraphNodesFromRegex(lua_State* L) {
if (!nodeName.empty() && identifier.find(nodeName) == std::string::npos) {
continue;
}
// Match entire string
else if (identifier != propertyName) {
continue;
}
foundMatch = true;
SceneGraphNode* parent = node->parent();