From fa2fca1ebf8215987a18e0822e78713639b7534c Mon Sep 17 00:00:00 2001 From: Muraoka Taro Date: Sun, 21 Dec 2025 19:09:20 +0000 Subject: [PATCH] patch 9.1.2003: tests: Test_glob_symlinks may fail on Window Problem: tests: Test_glob_symlinks may fail on Windows with UCRT runtime Solution: Comment out the code, do not use _wstat(). (author) For Test_glob_symlinks() to succeed, vim_stat() (which is actually mswin_stat_impl()) must fail on empty symlinks. When the dynamically linked C runtime is linked, _wstat() succeeds even on empty symbolic links. As a result, Test_glob_symlinks() fails. For details, see here: https://github.com/koron/vc-stat-behavior-verification closes: #18962 Signed-off-by: Muraoka Taro Signed-off-by: Christian Brabandt --- src/os_mswin.c | 14 +++++++++++++- src/version.c | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/os_mswin.c b/src/os_mswin.c index e407b563b0..2cf1be9d79 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -407,7 +407,19 @@ mswin_stat_impl(const WCHAR *name, stat_T *stp, const int resolve) DWORD flag = 0; WIN32_FIND_DATAW findDataW; -#ifdef _UCRT +#if 0 && defined(_UCRT) + // This code was disabled because the behavior of MSVC's _wstat (actually + // _wstat64) for empty symlinks varies depending on the C runtime you link + // to. + // + // The expected behavior here is for _wstat() to fail for empty symlinks. + // The expected behavior occurs when linking to a static runtime. However, + // the expected behavior does not occur when linking to a dynamic runtime, + // and it succeeds for empty symlinks. This causes Test_glob_symlinks in + // test_functions.vim to fail when linking to a dynamic runtime. + // + // For more details, see: + // https://github.com/koron/vc-stat-behavior-verification if (resolve) // Universal CRT can handle symlinks properly. return _wstat(name, stp); diff --git a/src/version.c b/src/version.c index 534d365e58..fbadafea2b 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2003, /**/ 2002, /**/ -- 2.47.3