From 154a6e69a4b9f90609161da7387ae0217cf7f8aa Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 16 May 2020 18:54:38 +1200 Subject: [PATCH] Shell: Use DirIterator::SkipParentAndBaseDir --- Shell/main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Shell/main.cpp b/Shell/main.cpp index 96db348f01..2f562c0a3d 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -1369,13 +1369,10 @@ int main(int argc, char** argv) // only suggest dot-files if path starts with a dot Core::DirIterator files(path, - token.starts_with('.') ? Core::DirIterator::NoFlags : Core::DirIterator::SkipDots); + token.starts_with('.') ? Core::DirIterator::SkipParentAndBaseDir : Core::DirIterator::SkipDots); while (files.has_next()) { auto file = files.next_path(); - // manually skip `.' and `..' - if (file == "." || file == "..") - continue; auto trivia = " "; if (file.starts_with(token)) { String file_path = String::format("%s/%s", path.characters(), file.characters()); @@ -1450,13 +1447,10 @@ int main(int argc, char** argv) // only suggest dot-files if path starts with a dot Core::DirIterator files(path, - token.starts_with('.') ? Core::DirIterator::NoFlags : Core::DirIterator::SkipDots); + token.starts_with('.') ? Core::DirIterator::SkipParentAndBaseDir : Core::DirIterator::SkipDots); while (files.has_next()) { auto file = files.next_path(); - // manually skip `.' and `..' - if (file == "." || file == "..") - continue; if (file.starts_with(token)) { struct stat program_status; String file_path = String::format("%s/%s", path.characters(), file.characters());