diff options
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/filesystem/dir.cc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc index 6ff12d0..4640d75 100644 --- a/libstdc++-v3/src/filesystem/dir.cc +++ b/libstdc++-v3/src/filesystem/dir.cc @@ -79,8 +79,7 @@ namespace return (obj & bits) != Bitmask::none; } - // Returns {dirp, p} on success, {nullptr, p} on error. - // If an ignored EACCES error occurs returns {}. + // Returns {dirp, p} on success, {} on error (whether ignored or not). inline fs::_Dir open_dir(const fs::path& p, fs::directory_options options, std::error_code* ec) @@ -102,7 +101,7 @@ namespace std::error_code(err, std::generic_category()))); ec->assign(err, std::generic_category()); - return {nullptr, p}; + return {}; } inline fs::file_type @@ -169,7 +168,7 @@ fs::_Dir::advance(error_code* ec, directory_options options) "directory iterator cannot advance", std::error_code(err, std::generic_category()))); ec->assign(err, std::generic_category()); - return true; + return false; } else { @@ -191,12 +190,6 @@ directory_iterator(const path& p, directory_options options, error_code* ec) if (sp->advance(ec, options)) _M_dir.swap(sp); } - else if (!dir.path.empty()) - { - // An error occurred, we need a non-empty shared_ptr so that *this will - // not compare equal to the end iterator. - _M_dir.reset(static_cast<fs::_Dir*>(nullptr)); - } } const fs::directory_entry& @@ -270,10 +263,6 @@ recursive_directory_iterator(const path& p, directory_options options, std::error_code(err, std::generic_category()))); ec->assign(err, std::generic_category()); - - // An error occurred, we need a non-empty shared_ptr so that *this will - // not compare equal to the end iterator. - _M_dirs.reset(static_cast<_Dir_stack*>(nullptr)); } } |