aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-04-11 14:39:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-04-11 14:39:31 +0200
commitd6e9703edbd28508882fab3ce698617d036abfdd (patch)
treeef544027338453bdd783996bca7856ed65ccc1e9 /libbuild2/config/init.cxx
parent87a7253a3bd82b59063172f3799b0a5587e7b2a5 (diff)
Diagnose empty paths in config.config.{load,save}
GitHub issue #372.
Diffstat (limited to 'libbuild2/config/init.cxx')
-rw-r--r--libbuild2/config/init.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx
index d1a57b9..2f134c4 100644
--- a/libbuild2/config/init.cxx
+++ b/libbuild2/config/init.cxx
@@ -487,7 +487,9 @@ namespace build2
const string& s (f.string ());
- if (s[0] != '~')
+ if (s.empty ())
+ fail << "empty path in config.config.load";
+ else if (s[0] != '~')
load_config_file (f, l);
else if (s == "~host" || s == "~host-no-warnings" ||
s == "~build2" || s == "~build2-no-warnings")