From 631c76d7613458dbef208ca056e194e94a5becf3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 30 Aug 2017 22:58:52 +0300 Subject: Make $getenv() to return untyped value --- build2/name.ixx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'build2/name.ixx') diff --git a/build2/name.ixx b/build2/name.ixx index c77846a..ef59442 100644 --- a/build2/name.ixx +++ b/build2/name.ixx @@ -23,4 +23,18 @@ namespace build2 return r; } + + inline name + to_name (string s) + { + if (!s.empty () && path::traits::is_separator (s.back ())) + { + dir_path d (move (s), dir_path::exact); + + if (!d.empty ()) + return name (move (d)); + } + + return name (move (s)); + } } -- cgit v1.1