From 06880d7ed8b8ef8658eb965e6614136c67988970 Mon Sep 17 00:00:00 2001 From: Benno Fünfstück Date: Mon, 15 May 2017 10:18:27 +0200 Subject: nix ls: support '/' for the root directory --- src/nix/ls.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nix/ls.cc b/src/nix/ls.cc index 3476dfb05287..417b7b421b1c 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); -- cgit 1.4.1