From d64343249c51a106649249de05c8d1c519b542ce Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Wed, 2 Apr 2025 08:28:53 -0400 Subject: KWSys 2025-04-02 (284a7281) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 284a7281f1d439bf97816dcdcb19c6fe5f146d85 (master). Upstream Shortlog ----------------- Brad King (1): d68a5d3f SystemTools: Comment why ChangeDirectory does not use UNC for long paths --- SystemTools.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SystemTools.cxx b/SystemTools.cxx index ef16256..463ff71 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -329,6 +329,9 @@ inline char const* Getcwd(char* buf, unsigned int len) } inline int Chdir(std::string const& dir) { + // We cannot use ToWindowsExtendedPath here because that causes a + // UNC path to be recorded as the process working directory, and + // can break child processes. return _wchdir(KWSYS_NAMESPACE::Encoding::ToWide(dir).c_str()); } inline void Realpath(std::string const& path, std::string& resolved_path, -- cgit v0.12