patch 9.1.2003: tests: Test_glob_symlinks may fail on Window
Commit:
https://github.com/vim/vim/commit/fa2fca1ebf8215987a18e0822e78713639b7534c
Author: Muraoka Taro <[email protected]>
Date: Sun Dec 21 19:09:20 2025 +0000
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/os_mswin.c b/src/os_mswin.c
index e407b563b..2cf1be9d7 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 534d365e5..fbadafea2 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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vXOtV-008wiX-Bp%40256bit.org.