Skip to content

Commit

Permalink
Treat nonexistent directories as if they are empty. (#191)
Browse files Browse the repository at this point in the history
Resolves microsoft/vcpkg#19552 and adds a test.
  • Loading branch information
BillyONeal authored Sep 10, 2021
1 parent b069c9d commit af08307
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/env-tools.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
. $PSScriptRoot/../end-to-end-tests-prelude.ps1

$env:VCPKG_DOWNLOADS = Join-Path $TestingRoot 'empty downloads'
Run-Vcpkg env --bin --tools --python set
Throw-IfFailed
18 changes: 15 additions & 3 deletions src/vcpkg/base/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit af08307

Please sign in to comment.