aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/script/script.cxx')
-rw-r--r--build2/test/script/script.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx
index 99ace23..51c08cb 100644
--- a/build2/test/script/script.cxx
+++ b/build2/test/script/script.cxx
@@ -624,14 +624,15 @@ namespace build2
{
// Search script scopes until we hit the root.
//
- const scope* p (this);
+ const scope* s (this);
do
{
- if (const value* v = p->vars.find (var))
- return lookup (v, &p->vars);
+ auto p (s->vars.find (var));
+ if (p.first != nullptr)
+ return lookup (*p.first, p.second, s->vars);
}
- while ((p->parent != nullptr ? (p = p->parent) : nullptr) != nullptr);
+ while ((s->parent != nullptr ? (s = s->parent) : nullptr) != nullptr);
return find_in_buildfile (var.name);
}