We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcc6eae commit 9386240Copy full SHA for 9386240
dll/kernel32.cpp
@@ -701,16 +701,10 @@ namespace kernel32 {
701
return false;
702
}
703
704
- // If pattern is empty, just iterate
705
- if (handle->pattern.empty()) {
706
- handle->it++;
707
- return handle->it != std::filesystem::directory_iterator();
708
- }
709
-
710
// Look for a matching file with the pattern
711
while (handle->it != std::filesystem::directory_iterator()) {
712
std::filesystem::path path = *handle->it;
713
- if (fnmatch(handle->pattern.c_str(), path.filename().c_str(), 0) == 0) {
+ if (!handle->pattern.empty() && fnmatch(handle->pattern.c_str(), path.filename().c_str(), 0) == 0) {
714
return true;
715
716
handle->it++;
0 commit comments