-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win32,python3: Fix crash when stdin is redirected
This causes crash on Windows when Vim is linked with Python 3.5 or later: ``` echo 1 | vim -c "py3 print(1)" - ``` Python 3.5 or later calls `io.py` in `Py_Initialize()`, and it calls `abort()` when stdin is redirected. This can be avoided by reconnecting stdin to CONIN$. However, we should consider that the python DLL and the Vim executable might be linked to different C runtime libraries. This tries to get stdin and freopen which are actually used in the python DLL, then calls `freopen("CONIN$", "r", stdin)` to reconnect stdin.
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters