Skip to content

Commit

Permalink
fixed stack indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Jan 4, 2021
1 parent 8d13b01 commit 56cd20b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ static int process_get_stdout(lua_State *L) {
case STDIO_CHANNEL_EXTERNAL_PATH_KIND:
lua_pop(L, 1); // remove process from stack
luaL_requiref(L, "io", luaopen_io, 0);
lua_getfield(L, 2, "open");
lua_replace(L, 2);
lua_getfield(L, 1, "open");
lua_replace(L, 1);
;
lua_pushstring(L, channel->path);
lua_pushstring(L, "r");
Expand Down Expand Up @@ -241,8 +241,8 @@ static int process_get_stderr(lua_State *L) {
case STDIO_CHANNEL_EXTERNAL_PATH_KIND:
lua_pop(L, 1); // remove process from stack
luaL_requiref(L, "io", luaopen_io, 0);
lua_getfield(L, 2, "open");
lua_replace(L, 2);
lua_getfield(L, 1, "open");
lua_replace(L, 1);
;
lua_pushstring(L, channel->path);
lua_pushstring(L, "r");
Expand Down

0 comments on commit 56cd20b

Please sign in to comment.