patch 9.2.0462: MS-Windows: workaround for assert error on GUI
Commit:
https://github.com/vim/vim/commit/3a1ac7ced28179a5b39a7135b5c242ec8bc06797
Author: K.Takata <
ken...@csc.jp>
Date: Sun May 10 16:34:01 2026 +0000
patch 9.2.0462: MS-Windows: workaround for assert error on GUI
Problem: When Vim is built with debug mode, gvim causes an assertion
error and stops working when running on Visual Studio
Debugger.
Solution: Stop calling _set_fmode() if not needed (Ken Takata).
closes: #20181
Signed-off-by: K.Takata <
ken...@csc.jp>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/os_win32.c b/src/os_win32.c
index ab12d5a05..31fa169a5 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -8100,7 +8100,8 @@ mch_fopen(const char *name, const char *mode)
vim_free(wm);
#if defined(DEBUG) && _MSC_VER >= 1400
- _set_fmode(oldMode);
+ if (oldMode != 0)
+ _set_fmode(oldMode);
#endif
return f;
}
diff --git a/src/version.c b/src/version.c
index 6b5b0e7e1..fd79c4354 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 462,
/**/
461,
/**/