mirror of
https://github.com/google/leveldb.git
synced 2025-02-04 07:10:10 +08:00
Fix GetChildren
This commit is contained in:
parent
abf441b657
commit
85ab8bc050
@ -571,8 +571,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();
|
||||
}
|
||||
|
@ -467,11 +467,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);
|
||||
|
Loading…
Reference in New Issue
Block a user