about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-13T13·32+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-13T14·03+0200
commit568a099c889e7ccc5a49b15575078e99acf8bc2f (patch)
tree92981c6f2c41a7801197e5f1fe8c5e9444fc90f9 /src/libutil
parent6d97d816565505606792050131b5d4d7fca33245 (diff)
canonPath(): Check against empty paths
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index a640a64c724e..0bd51afd1a9f 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -96,6 +96,8 @@ Path absPath(Path path, Path dir)
 
 Path canonPath(const Path & path, bool resolveSymlinks)
 {
+    assert(path != "");
+
     string s;
 
     if (path[0] != '/')