Updated lua.c to fix #3118 telnet issue

This commit is contained in:
Terry Ellison 2020-05-28 18:16:47 +01:00 committed by Marcel Stör
parent a04b085d71
commit 544ee81210
1 changed files with 2 additions and 1 deletions

View File

@ -335,7 +335,8 @@ static int l_read_stdin (lua_State *L) {
return 1; /* return false if pipe empty */
if (b[l-1] != '\n') {
/* likewise if not CR terminated, then unread and ditto */
lua_getfield(L, 1, "unread");
lua_insert(L, 1); /* insert false return above the pipe */
lua_getfield(L, 2, "unread");
lua_insert(L, 1); /* insert pipe.unread above the pipe */
lua_call(L, 2, 0); /* pobj:unread(line) */
return 1; /* return false */