From 921c2d503a63f4769fdf1c7e6eb31be2706f9bea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Oct 2020 14:20:44 +0200 Subject: Add ability to specify fallback value for NULL substitutions with in.null --- libbuild2/version/rule.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libbuild2/version/rule.cxx') diff --git a/libbuild2/version/rule.cxx b/libbuild2/version/rule.cxx index 6fd97ae..919dfcf 100644 --- a/libbuild2/version/rule.cxx +++ b/libbuild2/version/rule.cxx @@ -88,7 +88,8 @@ namespace build2 lookup (const location& l, action a, const target& t, - const string& n) const + const string& n, + const optional& null) const { // Note that this code will be executed during up-to-date check for each // substitution so let's try not to do anything overly sub-optimal here. @@ -108,7 +109,8 @@ namespace build2 return rule::lookup (l, // Standard lookup. a, t, - p == string::npos ? n : string (n, p + 1)); + p == string::npos ? n : string (n, p + 1), + null); } string pn (n, 0, p); -- cgit v1.1