diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 6fcce5d67..51cda9da4 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -115,7 +115,7 @@ void replaceEnv(const std::map & newEnv) Path absPath(Path path, std::optional dir, bool resolveSymlinks) { - if (path[0] != '/') { + if (path.empty() || path[0] != '/') { if (!dir) { #ifdef __GNU__ /* GNU (aka. GNU/Hurd) doesn't have any limitation on path