mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-04 08:04:49 +00:00
refactor(engine): fix variable / function shadowing
Improve variable names in the code surrounding the changes. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
@@ -81,12 +81,12 @@ rule_loader::context::context(const libsinsp::filter::ast::pos_info& pos,
|
||||
// Contexts based on conditions don't use the
|
||||
// filename. Instead the "name" is just the condition, and
|
||||
// uses a short prefix of the condition.
|
||||
std::string name = "\"" + (
|
||||
std::string condition_name = "\"" + (
|
||||
condition.length() > 20
|
||||
? condition.substr(0, 20 - 3) + "...\""
|
||||
: condition + "\"");
|
||||
std::replace(name.begin(), name.end(), '\n', ' ');
|
||||
std::replace(name.begin(), name.end(), '\r', ' ');
|
||||
std::replace(condition_name.begin(), condition_name.end(), '\n', ' ');
|
||||
std::replace(condition_name.begin(), condition_name.end(), '\r', ' ');
|
||||
|
||||
std::string item_name = "";
|
||||
|
||||
@@ -100,7 +100,7 @@ rule_loader::context::context(const libsinsp::filter::ast::pos_info& pos,
|
||||
condpos.line = pos.line + lastpos.pos.line;
|
||||
condpos.column = pos.col + lastpos.pos.column;
|
||||
|
||||
init(name, condpos, rule_loader::context::CONDITION_EXPRESSION, item_name, parent);
|
||||
init(condition_name, condpos, rule_loader::context::CONDITION_EXPRESSION, item_name, parent);
|
||||
}
|
||||
|
||||
const std::string& rule_loader::context::name() const
|
||||
|
Reference in New Issue
Block a user