Skip to content

Commit 8e0ad47

Browse files
committed
fixup! msvc: fix isatty()
1 parent ac221b3 commit 8e0ad47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/winansi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ static HANDLE duplicate_handle(HANDLE hnd)
478478
#if defined(_MSC_VER)
479479
static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
480480
{
481-
assert((fd == 1) || (fd == 2));
482481
DWORD key_std = ((fd == 1) ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
483482

484483
/*
@@ -491,6 +490,8 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
491490
/* Create a temp fd associated with the already open "new_handle". */
492491
int fd_temp = _open_osfhandle((intptr_t)new_handle, O_BINARY);
493492

493+
assert((fd == 1) || (fd == 2));
494+
494495
/*
495496
* Use stock dup2() to re-bind fd to the new handle. Note that
496497
* this will implicitly close(1) and close both fd=1 and the

0 commit comments

Comments
 (0)