summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-12-03 22:04:35 +0100
committerPřemysl Janouch <p@janouch.name>2018-12-03 22:04:35 +0100
commit315b662581f771ff521b2f826dede8470c082ed6 (patch)
tree07fdef586f63d0353007b40947e92ea99ecfb86b
parent4a2a49312b6c33bd73d338ca2744ab66a5cb7a6e (diff)
downloadsdn-315b662581f771ff521b2f826dede8470c082ed6.tar.gz
sdn-315b662581f771ff521b2f826dede8470c082ed6.tar.xz
sdn-315b662581f771ff521b2f826dede8470c082ed6.zip
Don't show .. in the root directory
-rw-r--r--sdn.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sdn.cpp b/sdn.cpp
index 0a5f2ee..05e9cc2 100644
--- a/sdn.cpp
+++ b/sdn.cpp
@@ -765,7 +765,8 @@ fun reload () {
while (auto f = readdir (dir)) {
string name = f->d_name;
// Two dots are for navigation but this ain't as useful
- if (name != "." && (name == ".." || name[0] != '.' || g.show_hidden))
+ if (name != "." && (name != ".." || g.cwd != "/")
+ && (name[0] != '.' || g.show_hidden))
g.entries.push_back (make_entry (f));
}
closedir (dir);