From d362a81e73e56c8e79114e327a6a9a53c8f8c008 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 12 Jun 2017 16:29:21 +0300 Subject: Fix crashing if path_search() fails --- build2/parser.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build2') diff --git a/build2/parser.cxx b/build2/parser.cxx index 0edb612..86f45cd 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -2415,7 +2415,7 @@ namespace build2 }; auto include_pattern = - [&r, &append, &include_match, sp] (string&& p, bool a) + [&r, &append, &include_match, sp, &l, this] (string&& p, bool a) { // If we don't already have any matches and our pattern doesn't contain // multiple recursive wildcards, then the result will be unique and we @@ -2458,7 +2458,14 @@ namespace build2 return true; }; - butl::path_search (path (move (p)), func, *sp); + try + { + butl::path_search (path (move (p)), func, *sp); + } + catch (const system_error& e) + { + fail (l) << "unable to scan " << *sp << ": " << e; + } }; auto exclude_match = [&r, &equal] (const string& m) -- cgit v1.1