From 87a7253a3bd82b59063172f3799b0a5587e7b2a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 2 Apr 2024 08:03:55 +0200 Subject: Detect and diagnose attempt to create new target in src directory GitHub issue #277. --- libbuild2/scope.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libbuild2/scope.cxx') diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx index 6ed7bab..23781a8 100644 --- a/libbuild2/scope.cxx +++ b/libbuild2/scope.cxx @@ -1205,8 +1205,8 @@ namespace build2 } auto scope_map:: - find (const dir_path& k) const -> pair + find (const dir_path& k, bool sno) const -> pair { assert (k.normalized (false)); auto i (map_.find_sup (k)); @@ -1215,9 +1215,9 @@ namespace build2 auto b (i->second.begin ()); auto e (i->second.end ()); - // Skip NULL first element. + // Skip NULL first element if requested. // - if (*b == nullptr) + if (sno && *b == nullptr) ++b; assert (b != e); -- cgit v1.1