From 20f97f06ce54c31e32cf58cfd1b7cae3617c1661 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 12:24:23 +0200 Subject: Get rid of var_extension char array --- libbuild2/target.txx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libbuild2/target.txx') diff --git a/libbuild2/target.txx b/libbuild2/target.txx index 8b17383..17c38c8 100644 --- a/libbuild2/target.txx +++ b/libbuild2/target.txx @@ -90,12 +90,11 @@ namespace build2 target_extension_var_impl (const target_type& tt, const string& tn, const scope& s, - const char* var, const char* def) { // Include target type/pattern-specific variables. // - if (auto l = s.find (s.ctx.var_pool[var], tt, tn)) + if (auto l = s.find (*s.ctx.var_extension, tt, tn)) { // Help the user here and strip leading '.' from the extension. // @@ -106,17 +105,17 @@ namespace build2 return def != nullptr ? optional (def) : nullopt; } - template + template optional target_extension_var (const target_key& tk, const scope& s, const char*, bool) { - return target_extension_var_impl (*tk.type, *tk.name, s, var, def); + return target_extension_var_impl (*tk.type, *tk.name, s, def); } - template + template bool target_pattern_var (const target_type& tt, const scope& s, @@ -144,7 +143,7 @@ namespace build2 // Use empty name as a target since we only want target type/pattern- // specific variables that match any target ('*' but not '*.txt'). // - if ((e = target_extension_var_impl (tt, string (), s, var, def))) + if ((e = target_extension_var_impl (tt, string (), s, def))) return true; } } -- cgit v1.1