From 6f78cb4299698aca908156d0090869676ee66b23 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 Jan 2025 12:01:53 +0200 Subject: Fix name pattern expansion for absolute path patterns (GH issue #453) --- libbuild2/parser.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index e6fd5bb..4242b96 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -7264,7 +7264,9 @@ namespace build2 (root_ != nullptr && root_->root_extra != nullptr && m.to_directory () && - exists (d.sp / m / root_->root_extra->buildignore_file))) + exists (m.relative () + ? d.sp / m / root_->root_extra->buildignore_file + : m / root_->root_extra->buildignore_file))) return !interm; // Note that we have to make copies of the extension since there will @@ -7320,9 +7322,11 @@ namespace build2 return true; }); + path pat (move (p)); + try { - path_search (path (move (p)), + path_search (pat, process, *sp, path_match_flags::follow_symlinks, @@ -7330,7 +7334,8 @@ namespace build2 } catch (const system_error& e) { - fail (l) << "unable to scan " << *sp << ": " << e; + fail (l) << "unable to scan for '" + << (pat.relative () ? *sp / pat : pat) << "': " << e; } }; -- cgit v1.1