diff options
Diffstat (limited to 'build2/config')
-rw-r--r-- | build2/config/operation.cxx | 18 | ||||
-rw-r--r-- | build2/config/utility.cxx | 2 | ||||
-rw-r--r-- | build2/config/utility.txx | 2 |
3 files changed, 7 insertions, 15 deletions
diff --git a/build2/config/operation.cxx b/build2/config/operation.cxx index 724b92d..7d6fc74 100644 --- a/build2/config/operation.cxx +++ b/build2/config/operation.cxx @@ -131,7 +131,7 @@ namespace build2 const variable& var (sv.var); pair<lookup, size_t> org (root.find_original (var)); - pair<lookup, size_t> ovr (var.override == nullptr + pair<lookup, size_t> ovr (var.overrides == nullptr ? org : root.find_override (var, org)); const lookup& l (ovr.first); @@ -859,19 +859,11 @@ namespace build2 { const variable& var (p.first->first); - // Annoyingly, this is one of the __override/__prefix/__suffix - // values. So we strip the last component. + // Annoyingly, this can be (always is?) one of the overrides + // (__override, __prefix, etc). // - size_t n (var.name.size ()); - - if (var.name.compare (n - 11, 11, ".__override") == 0) - n -= 11; - else if (var.name.compare (n - 9, 9, ".__prefix") == 0) - n -= 9; - else if (var.name.compare (n - 9, 9, ".__suffix") == 0) - n -= 9; - - m.save_variable (*vp.find (string (var.name, 0, n))); + size_t n (var.override ()); + m.save_variable (n != 0 ? *vp.find (string (var.name, 0, n)) : var); } // Now project-specific. For now we just save all of them and let diff --git a/build2/config/utility.cxx b/build2/config/utility.cxx index cc89d2f..e15c689 100644 --- a/build2/config/utility.cxx +++ b/build2/config/utility.cxx @@ -33,7 +33,7 @@ namespace build2 if (l.defined () && l->extra) n = true; - if (var.override != nullptr) + if (var.overrides != nullptr) { pair<lookup, size_t> ovr (r.find_override (var, move (org))); diff --git a/build2/config/utility.txx b/build2/config/utility.txx index 4f3429f..b8e0acc 100644 --- a/build2/config/utility.txx +++ b/build2/config/utility.txx @@ -47,7 +47,7 @@ namespace build2 else if (l->extra) n = (save_flags & save_commented) == 0; // Absence means default. - if (var.override != nullptr) + if (var.overrides != nullptr) { pair<lookup, size_t> ovr (root.find_override (var, move (org))); |