From 9c064fbbd20cff5e985d9856930769031809a368 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 1 Dec 2011 19:38:58 +0100 Subject: [PATCH] Win: utf-8 decoder bug when compiling with gcc --- src/win/tty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win/tty.c b/src/win/tty.c index b90d2cfe..6d8f6bca 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -1258,7 +1258,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle, uv_buf_t bufs[], int bufcnt, #ifdef _MSC_VER /* msvc */ if (_BitScanReverse(&first_zero_bit, not_c)) { #else /* assume gcc */ - if (first_zero_bit = __builtin_clzl(not_c), c != 0) { + if (c != 0) { + first_zero_bit = (sizeof(int) * 8) - 1 - __builtin_clz(not_c); #endif if (first_zero_bit == 7) { /* Ascii - pass right through */