From c08ea611759407b0e0c8dbea384c4f5273d27d3f Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Wed, 22 May 2024 23:23:55 +0200 Subject: fix --- src/term.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/term.c b/src/term.c index 18e6acb..704da80 100644 --- a/src/term.c +++ b/src/term.c @@ -656,6 +656,12 @@ static int lst_setnonblock(lua_State *L) return pusherror(L, "Error changing O_NONBLOCK: "); } +#else + HANDLE console_handle = get_console_handle(L, 1); + if (console_handle == NULL) { + return 2; // error message is already on the stack + } + #endif lua_pushboolean(L, 1); @@ -691,6 +697,11 @@ static int lst_getnonblock(lua_State *L) } #else + HANDLE console_handle = get_console_handle(L, 1); + if (console_handle == NULL) { + return 2; // error message is already on the stack + } + lua_pushboolean(L, 0); #endif -- cgit v1.2.3-55-g6feb