From a8027b97ecc67370edab3f87004d200eacf40026 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Mar 2018 02:21:59 -0800 Subject: [PATCH] Fix an inverted condition on MinGW I was reading over this crate a bit and found this (didn't actually run into it in the wild), but it seems like the intention here may have been to return `false` (aka not a tty) if `GetFileInformationByHandleEx` failed! --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 379bd94..7fba0cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,7 +123,7 @@ unsafe fn msys_tty_on(fd: DWORD) -> bool { name_info_bytes.len() as u32, ); if res == 0 { - return true; + return false; } let name_info: FILE_NAME_INFO = *(name_info_bytes[0..size].as_ptr() as *const FILE_NAME_INFO);