From d853d416fd3ad00c283c54fd09a881dbb50e52f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Jan 2024 07:14:12 +0200 Subject: Properly split injected ad hoc group member name in regex pattern rule --- libbuild2/adhoc-rule-regex-pattern.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libbuild2/adhoc-rule-regex-pattern.cxx') diff --git a/libbuild2/adhoc-rule-regex-pattern.cxx b/libbuild2/adhoc-rule-regex-pattern.cxx index c221bef..cd8c241 100644 --- a/libbuild2/adhoc-rule-regex-pattern.cxx +++ b/libbuild2/adhoc-rule-regex-pattern.cxx @@ -364,8 +364,9 @@ namespace build2 ? "explicit target group member" : "ad hoc target group member"))); - // @@ TODO: what if name contains extension? Shouldn't we call - // split_name()? + // @@ TODO: save location in constructor? + // + optional ext (target::split_name (n, location ())); if (g != nullptr) { @@ -384,7 +385,7 @@ namespace build2 move (d), dir_path (), // Always in out. move (n), - nullptr /* ext */, + ext ? &*ext : nullptr, &bs)); const target& t (l.first); // Note: non-const only if have lock. @@ -432,7 +433,8 @@ namespace build2 e.type, move (d), dir_path (), // Always in out. - move (n)); + move (n), + move (ext)); } } } -- cgit v1.1