From d730f40440e213bc08cce4587439960c80ad9aa5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Oct 2019 09:33:45 +0200 Subject: Redo bin pattern as PATH-like search paths rather than fallback directory Also, unlike the fallback directory, the search paths are searched first rather than last. --- libbuild2/utility.hxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'libbuild2/utility.hxx') diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx index 8256fa4..c362b34 100644 --- a/libbuild2/utility.hxx +++ b/libbuild2/utility.hxx @@ -225,7 +225,8 @@ namespace build2 try_run_search (const path&, bool init = false, const dir_path& fallback = dir_path (), - bool path_only = false); + bool path_only = false, + const char* paths = nullptr); // Wait for process termination. Issue diagnostics and throw failed in case // of abnormal termination. If the process has terminated normally but with @@ -674,7 +675,19 @@ namespace build2 // i.e., contains a single '*' character. // LIBBUILD2_SYMEXPORT string - apply_pattern (const char* stem, const string* pattern); + apply_pattern (const char* stem, const char* pattern); + + inline string + apply_pattern (const char* s, const string* p) + { + return apply_pattern (s, p != nullptr ? p->c_str () : nullptr); + } + + inline string + apply_pattern (const char* s, const string& p) + { + return apply_pattern (s, p.c_str ()); + } } #include -- cgit v1.1