Fix walk_path.
GitOrigin-RevId: a75c5a6314e3c5312cd94a5844d276710ec9944c
This commit is contained in:
parent
01a1538570
commit
6ffd4ce1f4
@ -225,7 +225,7 @@ if (NOT MSVC)
|
||||
# add_cxx_compiler_flag("-Wzero-as-null-pointer-constant")
|
||||
endif()
|
||||
|
||||
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0))
|
||||
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
|
||||
add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives
|
||||
endif()
|
||||
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0))
|
||||
|
@ -283,7 +283,7 @@ Result<bool> walk_path_subdir(string &path, DIR *dir, const WalkFunction &func)
|
||||
SCOPE_EXIT {
|
||||
path.resize(size);
|
||||
};
|
||||
Result<bool> status;
|
||||
Result<bool> status = true;
|
||||
#ifdef DT_DIR
|
||||
if (entry->d_type == DT_UNKNOWN) {
|
||||
status = walk_path(path, func);
|
||||
@ -296,9 +296,8 @@ Result<bool> walk_path_subdir(string &path, DIR *dir, const WalkFunction &func)
|
||||
#warning "Slow walk_path"
|
||||
status = walk_path(path, func);
|
||||
#endif
|
||||
TRY_RESULT(is_ok, std::move(status));
|
||||
if (!is_ok) {
|
||||
return false;
|
||||
if (status.is_error() || !status.ok()) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -315,9 +314,9 @@ Result<bool> walk_path_dir(string &path, DIR *subdir, const WalkFunction &func)
|
||||
case WalkPath::Action::Continue:
|
||||
break;
|
||||
}
|
||||
TRY_RESULT(is_ok, walk_path_subdir(path, subdir, func));
|
||||
if (!is_ok) {
|
||||
return false;
|
||||
auto status = walk_path_subdir(path, subdir, func);
|
||||
if (status.is_error() || !status.ok()) {
|
||||
return status;
|
||||
}
|
||||
switch (func(path, WalkPath::Type::ExitDir)) {
|
||||
case WalkPath::Action::Abort:
|
||||
|
Reference in New Issue
Block a user