diff options
Diffstat (limited to '')
-rw-r--r-- | src/term.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -493,6 +493,9 @@ static int lst_tcgetattr(lua_State *L) | |||
493 | lua_setfield(L, -2, "cc"); | 493 | lua_setfield(L, -2, "cc"); |
494 | 494 | ||
495 | #else | 495 | #else |
496 | lua_settop(L, 1); // remove all but file handle | ||
497 | get_console_handle(L, 1); //check args | ||
498 | |||
496 | lua_newtable(L); | 499 | lua_newtable(L); |
497 | lsbf_pushbitflags(L, 0); | 500 | lsbf_pushbitflags(L, 0); |
498 | lua_setfield(L, -2, "iflag"); | 501 | lua_setfield(L, -2, "iflag"); |
@@ -584,11 +587,12 @@ static int lst_tcsetattr(lua_State *L) | |||
584 | 587 | ||
585 | #else | 588 | #else |
586 | // Windows does not have a tcsetattr function, but we check arguments anyway | 589 | // Windows does not have a tcsetattr function, but we check arguments anyway |
587 | get_console_handle(L, 1); // to validate args | ||
588 | luaL_checkinteger(L, 2); | 590 | luaL_checkinteger(L, 2); |
589 | lsbf_checkbitflagsfield(L, 3, "iflag", t.c_iflag); | 591 | lsbf_checkbitflagsfield(L, 3, "iflag", 0); |
590 | lsbf_checkbitflagsfield(L, 3, "oflag", t.c_iflag); | 592 | lsbf_checkbitflagsfield(L, 3, "oflag", 0); |
591 | lsbf_checkbitflagsfield(L, 3, "lflag", t.c_iflag); | 593 | lsbf_checkbitflagsfield(L, 3, "lflag", 0); |
594 | lua_settop(L, 1); // remove all but file handle | ||
595 | get_console_handle(L, 1); | ||
592 | #endif | 596 | #endif |
593 | 597 | ||
594 | lua_pushboolean(L, 1); | 598 | lua_pushboolean(L, 1); |