aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp
index 0542af1e7..3d96e834b 100644
--- a/toolsrc/src/vcpkg/base/files.cpp
+++ b/toolsrc/src/vcpkg/base/files.cpp
@@ -55,9 +55,9 @@ namespace vcpkg::Files
virtual fs::path find_file_recursively_up(const fs::path& starting_dir,
const std::string& filename) const override
{
+ static const fs::path UNIX_ROOT = "/";
fs::path current_dir = starting_dir;
- fs::path unix_root = "/";
- for (; !current_dir.empty() && current_dir != unix_root; current_dir = current_dir.parent_path())
+ for (; !current_dir.empty() && current_dir != UNIX_ROOT; current_dir = current_dir.parent_path())
{
const fs::path candidate = current_dir / filename;
if (exists(candidate))