Shell: Use SkipParentAndBaseDir flag in DirIterator
This commit is contained in:
parent
6764b77788
commit
20d9c431ce
Notes:
sideshowbarker
2024-07-19 09:19:13 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/20d9c431cea Pull-request: https://github.com/SerenityOS/serenity/pull/1222
1 changed files with 1 additions and 5 deletions
|
@ -574,7 +574,7 @@ static Vector<String> expand_globs(const StringView& path, const StringView& bas
|
|||
StringView new_base_v = new_base;
|
||||
if (new_base_v.is_empty())
|
||||
new_base_v = ".";
|
||||
Core::DirIterator di(new_base_v, Core::DirIterator::NoFlags);
|
||||
Core::DirIterator di(new_base_v, Core::DirIterator::SkipParentAndBaseDir);
|
||||
|
||||
if (di.has_error()) {
|
||||
return res;
|
||||
|
@ -587,10 +587,6 @@ static Vector<String> expand_globs(const StringView& path, const StringView& bas
|
|||
if (name[0] == '.' && part[0] != '.')
|
||||
continue;
|
||||
|
||||
// And even if they are, skip . and ..
|
||||
if (name == "." || name == "..")
|
||||
continue;
|
||||
|
||||
if (name.matches(part, String::CaseSensitivity::CaseSensitive)) {
|
||||
|
||||
StringBuilder nested_base;
|
||||
|
|
Loading…
Add table
Reference in a new issue