aboutsummaryrefslogtreecommitdiff
path: root/build2/install/rule.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-10-08 21:16:33 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-10-08 21:17:20 +0300
commitac82bded6b2bdaf1e04b6357415c9f5ce04063dd (patch)
treeef603b8ac5f72e05f8e622630c2ad4aba17b0170 /build2/install/rule.cxx
parent680d3bd37638afc5ac80e8380c20318ff20feae7 (diff)
Fix crashing on empty installation directory name
Diffstat (limited to 'build2/install/rule.cxx')
-rw-r--r--build2/install/rule.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx
index f764363..75de96f 100644
--- a/build2/install/rule.cxx
+++ b/build2/install/rule.cxx
@@ -340,6 +340,9 @@ namespace build2
// installation directory name, e.g., bin, sbin, lib, etc. Look it
// up and recurse.
//
+ if (d.empty ())
+ fail << "empty installation directory name";
+
const string& sn (*d.begin ());
const string var ("install." + sn);
if (const dir_path* dn = lookup_install<dir_path> (s, var))