about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
authorBenno Fünfstück <benno.fuenfstueck@gmail.com>2017-05-15T08·18+0200
committerBenno Fünfstück <benno.fuenfstueck@gmail.com>2017-05-15T08·25+0200
commit06880d7ed8b8ef8658eb965e6614136c67988970 (patch)
treedc97850a1294b706fc24340aa06532c252bb4e55 /src/nix
parent510bc1735b3507b0f434303fdec5e824c879c838 (diff)
nix ls: support '/' for the root directory
Diffstat (limited to 'src/nix')
-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 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);