]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2003: tests: Test_glob_symlinks may fail on Window v9.1.2003
authorMuraoka Taro <koron.kaoriya@gmail.com>
Sun, 21 Dec 2025 19:09:20 +0000 (19:09 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Dec 2025 19:09:20 +0000 (19:09 +0000)
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 <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_mswin.c
src/version.c

index e407b563b0ba6d2d74d689d8784e45b316c52eb4..2cf1be9d79adff6123d5a46428f564fa1bafb4ff 100644 (file)
@@ -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);
index 534d365e584307a3ecb6e532527b681ae855a9bd..fbadafea2b0a6842b61969d8e168bc1726ff0efe 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2003,
 /**/
     2002,
 /**/