From 544ee812108c37a76ed11c8219f3b6503b1a853d Mon Sep 17 00:00:00 2001 From: Terry Ellison Date: Thu, 28 May 2020 18:16:47 +0100 Subject: [PATCH] Updated lua.c to fix #3118 telnet issue --- app/lua53/lua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lua53/lua.c b/app/lua53/lua.c index 43602f1299..9fb0868000 100644 --- a/app/lua53/lua.c +++ b/app/lua53/lua.c @@ -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 */