Skip to content

Commit e5442cd

Browse files
committed
Revert "Merge 'mingw-isatty' into HEAD"
Prepare to merge the latest iteration of the mingw-isatty patch series. This reverts commit 4af28e2, reversing changes made to 6cd98a7. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 12cd5d6 commit e5442cd

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

compat/mingw.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,6 @@ int mingw_raise(int sig);
472472
* ANSI emulation wrappers
473473
*/
474474

475-
int winansi_isatty(int fd);
476-
#define isatty winansi_isatty
477-
478475
void winansi_init(void);
479476
HANDLE winansi_get_osfhandle(int fd);
480477

compat/winansi.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ static void set_interactive(int fd, int bit)
2424

2525
#endif
2626

27-
/* In this file, we actually want to use Windows' own isatty(). */
28-
#undef isatty
29-
3027
/*
3128
ANSI codes used by git: m, K
3229
@@ -663,36 +660,6 @@ static void detect_msys_tty(int fd)
663660

664661
#endif
665662

666-
int winansi_isatty(int fd)
667-
{
668-
int res = isatty(fd);
669-
670-
if (res) {
671-
/*
672-
* Make sure that /dev/null is not fooling Git into believing
673-
* that we are connected to a terminal, as "_isatty() returns a
674-
* nonzero value if the descriptor is associated with a
675-
* character device."; for more information, see
676-
*
677-
* https://msdn.microsoft.com/en-us/library/f4s0ddew.aspx
678-
*/
679-
HANDLE handle = (HANDLE)_get_osfhandle(fd);
680-
if (fd == STDIN_FILENO) {
681-
DWORD dummy;
682-
683-
if (!GetConsoleMode(handle, &dummy))
684-
res = 0;
685-
} else if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {
686-
CONSOLE_SCREEN_BUFFER_INFO dummy;
687-
688-
if (!GetConsoleScreenBufferInfo(handle, &dummy))
689-
res = 0;
690-
}
691-
}
692-
693-
return res;
694-
}
695-
696663
void winansi_init(void)
697664
{
698665
int con1, con2;

0 commit comments

Comments
 (0)