@@ -1342,6 +1342,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
13421342 node = node->FirstChildElement (" rule" );
13431343 for (; node && strcmp (node->Value (), " rule" ) == 0 ; node = node->NextSiblingElement ()) {
13441344 Rule rule;
1345+ Regex::Engine regexEngine = Regex::Engine::Unknown;
13451346
13461347 for (const tinyxml2::XMLElement *subnode = node->FirstChildElement (); subnode; subnode = subnode->NextSiblingElement ()) {
13471348 const char * const subname = subnode->Name ();
@@ -1374,7 +1375,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
13741375 else if (std::strcmp (subname, " engine" ) == 0 ) {
13751376 const char * const engine = empty_if_null (subtext);
13761377 if (std::strcmp (engine, " pcre" ) == 0 ) {
1377- rule. engine = Regex::Engine::Pcre;
1378+ regexEngine = Regex::Engine::Pcre;
13781379 }
13791380 else {
13801381 mLogger .printError (std::string (" unknown regex engine '" ) + engine + " '." );
@@ -1408,7 +1409,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
14081409 }
14091410
14101411 std::string regex_err;
1411- auto regex = Regex::create (rule.pattern , rule. engine , regex_err);
1412+ auto regex = Regex::create (rule.pattern , regexEngine , regex_err);
14121413 if (!regex) {
14131414 mLogger .printError (" unable to load rule-file '" + ruleFile + " ' - pattern '" + rule.pattern + " ' failed to compile (" + regex_err + " )." );
14141415 return Result::Fail;
0 commit comments