]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/mingw-isatty'
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)
A hotfix for a topic already in 'master'.

* js/mingw-isatty:
  mingw: make stderr unbuffered again

compat/winansi.c

index 82b89ab13767a5e562d4f41826d98bce0d704e1c..793420f9d0d7732cb7dc2aa94845a22086fe7021 100644 (file)
@@ -510,6 +510,8 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
         */
        close(new_fd);
 
+       if (fd == 2)
+               setvbuf(stderr, NULL, _IONBF, BUFSIZ);
        fd_is_interactive[fd] |= FD_SWAPPED;
 
        return duplicate;
@@ -547,6 +549,8 @@ static void detect_msys_tty(int fd)
                        !wcsstr(name, L"-pty"))
                return;
 
+       if (fd == 2)
+               setvbuf(stderr, NULL, _IONBF, BUFSIZ);
        fd_is_interactive[fd] |= FD_MSYS;
 }