aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/rule.cxx')
-rw-r--r--libbuild2/rule.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbuild2/rule.cxx b/libbuild2/rule.cxx
index 7ccee4e..4b2d69d 100644
--- a/libbuild2/rule.cxx
+++ b/libbuild2/rule.cxx
@@ -94,13 +94,15 @@ namespace build2
// derivation function to treat this as a prerequisite (just like in
// search_existing_file()).
//
- if (pt->derive_extension (true) == nullptr)
+ if (const string* e = pt->derive_extension (true))
+ {
+ p = &pt->derive_path_with_extension (*e);
+ }
+ else
{
l4 ([&]{trace << "no default extension for target " << *pt;});
return false;
}
-
- p = &pt->derive_path ();
}
ts = mtime (*p);