diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-11-26 08:27:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-11-26 08:27:07 +0200 |
commit | 2164f1544357c0bad38fd23885290a099a1beb3a (patch) | |
tree | f3b884f4c6e2ca4ff98a116611dec81c1c60aeb9 /libbuild2/cc/common.cxx | |
parent | d282f0b8d41b7b8f584dff215fc892367895af3b (diff) |
Sanitize as identifiers <name>/<type in config.import.<proj>.<name>.<type>
Diffstat (limited to 'libbuild2/cc/common.cxx')
-rw-r--r-- | libbuild2/cc/common.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index ae89a85..c1e60d2 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -1017,7 +1017,10 @@ namespace build2 // auto lookup_import = [&rs, &act, - &name, + namev = + (p.proj + ? sanitize_identifier (name) + : string ()), projv = (p.proj ? p.proj->variable () @@ -1025,7 +1028,9 @@ namespace build2 { if (!projv.empty ()) { - string varn ("config.import." + projv + '.' + name + '.' + tt); + // Note: we know tt is liba or libs and need not to be sanitized. + // + string varn ("config.import." + projv + '.' + namev + '.' + tt); if (config::specified_config (rs, varn, true /* exact */)) { |