From 2164f1544357c0bad38fd23885290a099a1beb3a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Nov 2024 08:27:07 +0200 Subject: Sanitize as identifiers /.. --- libbuild2/cc/common.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libbuild2/cc') 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 */)) { -- cgit v1.1