Skip to content

Commit 8f85c9b

Browse files
authored
Updated lua.c to fix #3118 telnet issue
1 parent cc18f40 commit 8f85c9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/lua53/lua.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ static int l_read_stdin (lua_State *L) {
335335
return 1; /* return false if pipe empty */
336336
if (b[l-1] != '\n') {
337337
/* likewise if not CR terminated, then unread and ditto */
338-
lua_getfield(L, 1, "unread");
338+
lua_insert(L, 1); /* insert false return above the pipe */
339+
lua_getfield(L, 2, "unread");
339340
lua_insert(L, 1); /* insert pipe.unread above the pipe */
340341
lua_call(L, 2, 0); /* pobj:unread(line) */
341342
return 1; /* return false */

0 commit comments

Comments
 (0)