From 278140ebf2bc97eb72a1e8adb04a40a0a5807d8f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 4 Nov 2016 10:51:57 +0300 Subject: Add mkdir and touch builtins --- build2/test/script/script.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build2/test/script/script.cxx') diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx index cfc1d91..7d1d8cf 100644 --- a/build2/test/script/script.cxx +++ b/build2/test/script/script.cxx @@ -347,7 +347,16 @@ namespace build2 assert (!implicit || c.type == cleanup_type::always); - auto pr = [&c] (const cleanup& v) -> bool {return v.path == c.path;}; + const path& p (c.path); + if (!p.sub (root->wd_path)) + { + if (implicit) + return; + else + assert (false); // Error so should have been checked. + } + + auto pr = [&p] (const cleanup& v) -> bool {return v.path == p;}; auto i (find_if (cleanups.begin (), cleanups.end (), pr)); if (i == cleanups.end ()) -- cgit v1.1