aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-06-12 16:29:21 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-06-12 16:34:26 +0300
commitd362a81e73e56c8e79114e327a6a9a53c8f8c008 (patch)
tree855ff43ce3b5ef871e286d9da2b164c7328de89f /build2
parent5aa9c718cc347f00bc56c86d26015adc3781f5f9 (diff)
Fix crashing if path_search() fails
Diffstat (limited to 'build2')
-rw-r--r--build2/parser.cxx11
1 files changed, 9 insertions, 2 deletions
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)