]> granicus.if.org Git - vim/commitdiff
patch 8.2.1790: MS-Windows with Python: crash when executed from Vifm v8.2.1790
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Oct 2020 11:57:13 +0000 (13:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Oct 2020 11:57:13 +0000 (13:57 +0200)
Problem:    MS-Windows with Python: crash when executed from Vifm.
Solution:   Use NUL instead of CONIN. (Ken Takata, closes #7061, closes #7053)

src/if_python3.c
src/version.c

index 214ba29830e72c4497577660baf6ecea195b277f..15c1d9973e862f112332d696c6345e9d0af8b093 100644 (file)
@@ -909,7 +909,7 @@ static wchar_t *py_home_buf = NULL;
 
 #if defined(MSWIN) && (PY_VERSION_HEX >= 0x030500f0)
 // Python 3.5 or later will abort inside Py_Initialize() when stdin is
-// redirected.  Reconnect stdin to CONIN$.
+// redirected.  Reconnect stdin to NUL.
 // Note that the python DLL is linked to its own stdio DLL which can be
 // differ from Vim's stdio.
     static void
@@ -938,11 +938,11 @@ reset_stdin(void)
            pyfreopen = (void*)GetProcAddress(hpystdiodll, "freopen");
     }
 
-    // Reconnect stdin to CONIN$.
+    // Reconnect stdin to NUL.
     if (pyfreopen)
-       pyfreopen("CONIN$", "r", py__acrt_iob_func(0));
+       pyfreopen("NUL", "r", py__acrt_iob_func(0));
     else
-       freopen("CONIN$", "r", stdin);
+       freopen("NUL", "r", stdin);
 }
 #else
 # define reset_stdin()
index 4280ac56284c7f7e2affdc836f926381235700f1..a9b6e5dab145dd4b951283aa508d6689937c6453 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1790,
 /**/
     1789,
 /**/