From 67643a0ea34aa58337680266024fecb9f04b3eb5 Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Fri, 9 Aug 2019 10:29:02 -0700 Subject: [vcpkg] fix 7616 There's a bug in `std::experimental::filesystem::status` on libstdc++ -- it incorrectly sets its `error_code` when a file doesn't exist, or when a path doesn't exist. In order to get around this, `error_code` was cleared when the file doesn't exist, but it was not cleared when the path didn't exist. Note: in this case, I say "the file doesn't exist" when, if you look up "a/b/c", "a/b" exists but "c" doesn't. I say "the path doesn't exist" when, if you look up "a/b/c", either "a" or "a/b" doesn't exist. --- toolsrc/src/vcpkg/base/files.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 4a0a52f06..eb6119f18 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -78,7 +78,7 @@ namespace fs::detail #else auto result = symlink ? stdfs::symlink_status(p, ec) : stdfs::status(p, ec); // libstdc++ doesn't correctly not-set ec on nonexistent paths - if (ec.value() == ENOENT) + if (ec.value() == ENOENT || ec.value() == ENOTDIR) { ec.clear(); result = file_status(file_type::not_found, perms::unknown); -- cgit v1.2.3