1
0
mirror of https://github.com/google/leveldb.git synced 2025-04-15 13:20:37 +08:00
This commit is contained in:
Pavel Pimenov 2025-03-19 11:35:22 +06:00 committed by GitHub
commit 25c402003f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -609,8 +609,12 @@ class PosixEnv : public Env {
}
struct ::dirent* entry;
while ((entry = ::readdir(dir)) != nullptr) {
if (!(entry->d_name[0] == '.' && entry->d_name[1] == '\0' ||
entry->d_name[0] == '.' && entry->d_name[1] == '.' &&
entry->d_name[2] == '\0')) {
result->emplace_back(entry->d_name);
}
}
::closedir(dir);
return Status::OK();
}

View File

@ -507,11 +507,14 @@ class WindowsEnv : public Env {
do {
char base_name[_MAX_FNAME];
char ext[_MAX_EXT];
if(!(find_data.cFileName[0] == '.' && find_data.cFileName[1] == '\0' ||
find_data.cFileName[0] == '.' && find_data.cFileName[1] == '.' &&
find_data.cFileName[2] == '\0')) {
if (!_splitpath_s(find_data.cFileName, nullptr, 0, nullptr, 0, base_name,
ARRAYSIZE(base_name), ext, ARRAYSIZE(ext))) {
result->emplace_back(std::string(base_name) + ext);
}
}
} while (::FindNextFileA(dir_handle, &find_data));
DWORD last_error = ::GetLastError();
::FindClose(dir_handle);