diff options
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r-- | src/libutil/util.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 691b03bb0..bbd57434d 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -115,7 +115,7 @@ void replaceEnv(const std::map<std::string, std::string> & newEnv) Path absPath(Path path, std::optional<PathView> 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 |