Skip to content

Commit

Permalink
Fix Logic Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pegvin authored Oct 3, 2023
1 parent be57bfb commit 06fde91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ bool Fs::ListDir(const String& _dP, ListDirCallback cb) {
do {
if (wcscmp(fdFile.cFileName, L".") != 0 && wcscmp(fdFile.cFileName, L"..") != 0) {
bool isDir = fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
cb(WideString_To_UTF8(fdFile.cFileName), !isDir);
if (!cb(WideString_To_UTF8(fdFile.cFileName), !isDir)) {
break;
}
}
} while(FindNextFileW(hFind, &fdFile));

Expand All @@ -182,7 +184,7 @@ bool Fs::ListDir(const String& _dP, ListDirCallback cb) {
return false;
} else if (ent->d_name[0] == '.') {
continue; // skip "." & ".." entries
} else if (cb(ent->d_name, !isDir)) {
} else if (!cb(ent->d_name, !isDir)) {
break;
}
}
Expand Down

0 comments on commit 06fde91

Please sign in to comment.