aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/utility.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-06-06 11:30:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-06-06 11:30:04 +0200
commit38db461e03e949916221f7ae99b06751a3d05cce (patch)
tree94974621ad13ac162100cbb7872c4d89411f6e9d /libbuild2/config/utility.cxx
parentef130e855b5ac0f4acbb8b5b6fcd14069df8afe5 (diff)
Add another config::origin() overload
Diffstat (limited to 'libbuild2/config/utility.cxx')
-rw-r--r--libbuild2/config/utility.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/libbuild2/config/utility.cxx b/libbuild2/config/utility.cxx
index 243c03a..a64d4d5 100644
--- a/libbuild2/config/utility.cxx
+++ b/libbuild2/config/utility.cxx
@@ -177,14 +177,19 @@ namespace build2
origin (const scope& rs, const variable& var)
{
// Make sure this is a config.* variable. This could matter since we
- // reply on the semantics of value::extra. We could also detect
+ // rely on the semantics of value::extra. We could also detect
// special variables like config.booted, some config.config.*, etc.,
// (see config_save() for details) but that seems harmless.
//
if (var.name.compare (0, 7, "config.") != 0)
throw invalid_argument ("config.* variable expected");
- pair<lookup, size_t> org (rs.lookup_original (var));
+ return origin (rs, var, rs.lookup_original (var));
+ }
+
+ pair<variable_origin, lookup>
+ origin (const scope& rs, const variable& var, pair<lookup, size_t> org)
+ {
pair<lookup, size_t> ovr (var.overrides == nullptr
? org
: rs.lookup_override (var, org));