From 280f4a5bf787587227ca193cd59c6bd74091db70 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Feb 2018 14:07:01 +0200 Subject: Diagnose out_base inside src_base --- build2/b.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build2/b.cxx') diff --git a/build2/b.cxx b/build2/b.cxx index 1106031..b827470 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -726,6 +726,14 @@ main (int argc, char* argv[]) // src_base.normalize (true); + // Make sure out_base is not a subdirectory of src_base. Who would + // want to do that, you may ask. Well, you would be surprised... + // + if (out_base != src_base && out_base.sub (src_base)) + fail << "out_base directory is inside src_base" << + info << "src_base: " << src_base << + info << "out_base: " << out_base; + // If the src_base was explicitly specified, search for src_root. // src_root = find_src_root (src_base); -- cgit v1.1