aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/version
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-10-15 14:20:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-15 14:20:44 +0200
commit921c2d503a63f4769fdf1c7e6eb31be2706f9bea (patch)
tree487698c7e2877dec1eed4945cd2d1e9e09b7eb66 /libbuild2/version
parent291a737de8f92a7f620853133aa404b98e552a21 (diff)
Add ability to specify fallback value for NULL substitutions with in.null
Diffstat (limited to 'libbuild2/version')
-rw-r--r--libbuild2/version/rule.cxx6
-rw-r--r--libbuild2/version/rule.hxx3
2 files changed, 6 insertions, 3 deletions
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<string>& 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);
diff --git a/libbuild2/version/rule.hxx b/libbuild2/version/rule.hxx
index f9e7655..ddc5e11 100644
--- a/libbuild2/version/rule.hxx
+++ b/libbuild2/version/rule.hxx
@@ -29,7 +29,8 @@ namespace build2
lookup (const location&,
action,
const target&,
- const string&) const override;
+ const string&,
+ const optional<string>&) const override;
};
// Pre-process manifest before installation to patch in the version.