diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2017-05-15T09·02+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-15T09·02+0200 |
commit | 0124d118ef6718716f740ebfd3ae5eff0453be9e (patch) | |
tree | dc97850a1294b706fc24340aa06532c252bb4e55 | |
parent | 510bc1735b3507b0f434303fdec5e824c879c838 (diff) | |
parent | 06880d7ed8b8ef8658eb965e6614136c67988970 (diff) |
Merge pull request #1387 from bennofs/nix-ls-slash
nix ls: support '/' for the root directory
-rw-r--r-- | src/nix/ls.cc | 4 |
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); |