mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 02:57:09 +01:00
[vcpkg] Fix crash when trying to enumerate nonexistent directory.
This commit is contained in:
parent
6609d3d32e
commit
0ef1bbb38c
@ -74,6 +74,7 @@ namespace vcpkg::Files
|
|||||||
|
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
fs::stdfs::recursive_directory_iterator b(dir, ec), e{};
|
fs::stdfs::recursive_directory_iterator b(dir, ec), e{};
|
||||||
|
if (ec) return ret;
|
||||||
for (; b != e; ++b)
|
for (; b != e; ++b)
|
||||||
{
|
{
|
||||||
ret.push_back(b->path());
|
ret.push_back(b->path());
|
||||||
@ -86,7 +87,9 @@ namespace vcpkg::Files
|
|||||||
{
|
{
|
||||||
std::vector<fs::path> ret;
|
std::vector<fs::path> ret;
|
||||||
|
|
||||||
fs::stdfs::directory_iterator b(dir), e{};
|
std::error_code ec;
|
||||||
|
fs::stdfs::directory_iterator b(dir, ec), e{};
|
||||||
|
if (ec) return ret;
|
||||||
for (; b != e; ++b)
|
for (; b != e; ++b)
|
||||||
{
|
{
|
||||||
ret.push_back(b->path());
|
ret.push_back(b->path());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user