Treat nonexistent directories as if they are empty.
Resolves and adds a test.
ADD
azure-pipelines/end-to-end-tests-dir/env-tools.ps1
+. $PSScriptRoot/../end-to-end-tests-prelude.ps1
+
+$env:VCPKG_DOWNLOADS = Join-Path $TestingRoot 'empty downloads'
+Run-Vcpkg env --bin --tools --python set
+Throw-IfFailed

MODIFY
src/vcpkg/base/files.cpp
src/vcpkg/base/files.cpp
@@ -1552,7 +1552,11 @@ namespace vcpkg
{
std::vector<Path> ret;
Iter b(to_stdfs_path(dir), ec), e{};
- if (!ec)
+ if (ec)
+ {
+ translate_not_found_to_success(ec);
+ }
+ else
{
while (b != e)
{
@@ -1584,7 +1588,11 @@ namespace vcpkg
{
std::vector<Path> ret;
Iter b(to_stdfs_path(dir), ec), e{};
- if (!ec)
+ if (ec)
+ {
+ translate_not_found_to_success(ec);
+ }
+ else
{
while (b != e)
{
@@ -1630,7 +1638,11 @@ namespace vcpkg
{
std::vector<Path> ret;
Iter b(to_stdfs_path(dir), ec), e{};
- if (!ec)
+ if (ec)
+ {
+ translate_not_found_to_success(ec);
+ }
+ else
{
while (b != e)
{

Treat nonexistent directories as if they are empty. (#191)

Resolves https://github.com/microsoft/vcpkg/issues/19552 and adds a test.