patch 9.2.0462: MS-Windows: workaround for assert error on GUI

Commit: 
https://github.com/vim/vim/commit/3a1ac7ced28179a5b39a7135b5c242ec8bc06797
Author: K.Takata <[email protected]>
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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

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,
 /**/

-- 
-- 
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/E1wM7H8-00Fdpe-I9%40256bit.org.

Raspunde prin e-mail lui