Skip to content

Commit e048a25

Browse files
committed
Merge branch 'js/mingw-isatty'
A hotfix for a topic already in 'master'. * js/mingw-isatty: mingw: make stderr unbuffered again
2 parents 1e00c41 + a4d92d5 commit e048a25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/winansi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
510510
*/
511511
close(new_fd);
512512

513+
if (fd == 2)
514+
setvbuf(stderr, NULL, _IONBF, BUFSIZ);
513515
fd_is_interactive[fd] |= FD_SWAPPED;
514516

515517
return duplicate;
@@ -547,6 +549,8 @@ static void detect_msys_tty(int fd)
547549
!wcsstr(name, L"-pty"))
548550
return;
549551

552+
if (fd == 2)
553+
setvbuf(stderr, NULL, _IONBF, BUFSIZ);
550554
fd_is_interactive[fd] |= FD_MSYS;
551555
}
552556

0 commit comments

Comments
 (0)