diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-01-11 07:14:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-01-11 07:14:12 +0200 |
commit | d853d416fd3ad00c283c54fd09a881dbb50e52f5 (patch) | |
tree | 3e8b2837be14cd419c6be81b32568a2a31f69424 /libbuild2/adhoc-rule-regex-pattern.cxx | |
parent | 7197d069cb82286f9789a8ce987fe5f0f5b6f05d (diff) |
Properly split injected ad hoc group member name in regex pattern rule
Diffstat (limited to 'libbuild2/adhoc-rule-regex-pattern.cxx')
-rw-r--r-- | libbuild2/adhoc-rule-regex-pattern.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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<string> 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)); } } } |