aboutsummaryrefslogtreecommitdiff
path: root/src/nix/ls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/ls.cc')
-rw-r--r--src/nix/ls.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nix/ls.cc b/src/nix/ls.cc
index 3476dfb05..417b7b421 100644
--- a/src/nix/ls.cc
+++ b/src/nix/ls.cc
@@ -61,6 +61,10 @@ struct MixLs : virtual Args
showFile(curPath, relPath);
};
+ if (path == "/") {
+ path = "";
+ }
+
auto st = accessor->stat(path);
if (st.type == FSAccessor::Type::tMissing)
throw Error(format("path ‘%1%’ does not exist") % path);