aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicole Mazzuca <mazzucan@outlook.com>2019-08-09 10:29:02 -0700
committernicole mazzuca <mazzucan@outlook.com>2019-08-09 10:48:37 -0700
commit67643a0ea34aa58337680266024fecb9f04b3eb5 (patch)
treeab5a36fe15368cb7e1eb6cc84e31cb76733f3008
parent14c792441dc5963d0d17cb2e7a6dc1b2f7665d9b (diff)
downloadvcpkg-67643a0ea34aa58337680266024fecb9f04b3eb5.tar.gz
vcpkg-67643a0ea34aa58337680266024fecb9f04b3eb5.zip
[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.
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp2
1 files changed, 1 insertions, 1 deletions
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);