aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
authorPhoebe <925731795@qq.com>2019-09-18 00:35:50 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-09-17 09:35:50 -0700
commitb4a0c8d57453cd77c5958800c345e6fd9938f0a4 (patch)
tree4c4a7e71ac2c1909b60c8f687330ecc8c5ec73a7 /toolsrc
parent9130c3dfbe61b0f9525145153c1c43bee6590f37 (diff)
downloadvcpkg-b4a0c8d57453cd77c5958800c345e6fd9938f0a4.tar.gz
vcpkg-b4a0c8d57453cd77c5958800c345e6fd9938f0a4.zip
[vcpkg] Continue on malformed paths in PATH (#8129)
Previously vcpkg would exit on malformed paths. We now will continue and ignore the malformed path.
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp
index 5ebe8d834..3d7df1a68 100644
--- a/toolsrc/src/vcpkg/base/files.cpp
+++ b/toolsrc/src/vcpkg/base/files.cpp
@@ -185,6 +185,7 @@ namespace vcpkg::Files
if (ec) Checks::exit_with_message(li, "error checking existence of file %s: %s", path.u8string(), ec.message());
return result;
}
+
bool Filesystem::exists(const fs::path& path) const
{
std::error_code ec;
@@ -667,13 +668,14 @@ namespace vcpkg::Files
auto paths = Strings::split(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO), ";");
std::vector<fs::path> ret;
+ std::error_code ec;
for (auto&& path : paths)
{
auto base = path + "/" + name;
for (auto&& ext : EXTS)
{
auto p = fs::u8path(base + ext.c_str());
- if (Util::find(ret, p) == ret.end() && this->exists(VCPKG_LINE_INFO, p))
+ if (Util::find(ret, p) == ret.end() && this->exists(p, ec))
{
ret.push_back(p);
Debug::print("Found path: ", p.u8string(), '\n');