We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc18f40 commit 8f85c9bCopy full SHA for 8f85c9b
app/lua53/lua.c
@@ -335,7 +335,8 @@ static int l_read_stdin (lua_State *L) {
335
return 1; /* return false if pipe empty */
336
if (b[l-1] != '\n') {
337
/* likewise if not CR terminated, then unread and ditto */
338
- lua_getfield(L, 1, "unread");
+ lua_insert(L, 1); /* insert false return above the pipe */
339
+ lua_getfield(L, 2, "unread");
340
lua_insert(L, 1); /* insert pipe.unread above the pipe */
341
lua_call(L, 2, 0); /* pobj:unread(line) */
342
return 1; /* return false */
0 commit comments