From d109616006be29c4106966f77d0c0b22d51372ca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Dec 2015 18:04:13 +0200 Subject: Strip leading '.' from extension variable values --- build/target.txx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build/target.txx b/build/target.txx index 89a402e..a63994b 100644 --- a/build/target.txx +++ b/build/target.txx @@ -23,7 +23,13 @@ namespace build // Include target type/pattern-specific variables. // if (auto l = s.lookup (tk, var)) - return extension_pool.find (as (*l)); + { + // Help the user here and strip leading '.' from the extension. + // + const string& e (as (*l)); + return extension_pool.find ( + !e.empty () && e.front () == '.' ? string (e, 1) : e); + } if (def != nullptr) return extension_pool.find (def); -- cgit v1.1