Do not list ".." as a subdirectory of the root directory

In Linux "/.." exists and loops back onto the root. But for the user
it is confusing to see a ".." entry listed that does nothing when
selected, so hide it.
This commit is contained in:
Maarten ter Huurne
2014-08-17 10:20:22 +02:00
parent 0b0e278459
commit 20725fcdda
+1 -1
View File
@@ -88,7 +88,7 @@ bool FileLister::browse(const string& path, bool clean)
while (struct dirent *dptr = readdir(dirp)) {
// Ignore hidden files and optionally "..".
if (dptr->d_name[0] == '.') {
if (!(dptr->d_name[1] == '.' && showUpdir)) {
if (!(dptr->d_name[1] == '.' && showUpdir && slashedPath != "/")) {
continue;
}
}