Don't show .. in the root directory

This commit is contained in:
Přemysl Eric Janouch 2018-12-03 22:04:35 +01:00
parent 4a2a49312b
commit 315b662581
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 1 deletions

View File

@ -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);