mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
fix(windows): set stdout to binary mode for --api-info
Problem: --api-info output is binary. Not setting the mode may cause
the OS to impose unexpected eof. For Windows, it scatters extra '0d0a'
words in the output.
Solution: On Windows, set stdout to binary mode for --api-info.
Fixes #20977
(cherry picked from commit 4bfc7802f0
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
624c25a70a
commit
9e603ec3e1
@@ -1058,6 +1058,10 @@ static void command_line_scan(mparm_T *parmp)
|
||||
version();
|
||||
os_exit(0);
|
||||
} else if (STRICMP(argv[0] + argv_idx, "api-info") == 0) {
|
||||
#ifdef MSWIN
|
||||
// set stdout to binary to avoid crlf in --api-info output
|
||||
_setmode(STDOUT_FILENO, _O_BINARY);
|
||||
#endif
|
||||
FileDescriptor fp;
|
||||
const int fof_ret = file_open_fd(&fp, STDOUT_FILENO,
|
||||
kFileWriteOnly);
|
||||
|
Reference in New Issue
Block a user