1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 23:07:35 +00:00

FileManager: Don't show "." and ".." in directory views.

This commit is contained in:
Andreas Kling 2019-03-24 12:27:02 +01:00
parent f18ed4f633
commit 900a3966e2
2 changed files with 3 additions and 1 deletions

View file

@ -227,6 +227,8 @@ void DirectoryModel::update()
while (auto* de = readdir(dirp)) {
Entry entry;
entry.name = de->d_name;
if (entry.name == "." || entry.name == "..")
continue;
struct stat st;
int rc = lstat(String::format("%s/%s", m_path.characters(), de->d_name).characters(), &st);
if (rc < 0) {