diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-10-29 13:09:31 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-10-29 13:09:31 +0000 |
commit | 431d4e8eff513622eaa1b6e3f0803913c0abb975 (patch) | |
tree | 57fab0a350fd1aa29e4fe283163166fbb7e30c91 /libs/nixio/src/process.c | |
parent | 94784db12b33d53c6da1b2a9195d40319766361c (diff) |
merge branch changes into trunk
Diffstat (limited to 'libs/nixio/src/process.c')
-rw-r--r-- | libs/nixio/src/process.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/nixio/src/process.c b/libs/nixio/src/process.c index 45c06a644e..5ae9b829ea 100644 --- a/libs/nixio/src/process.c +++ b/libs/nixio/src/process.c @@ -65,14 +65,14 @@ int nixio__exec(lua_State *L, int m) { return luaL_error(L, "stack overflow"); } - if (!lua_type(L, -2) != LUA_TSTRING || !lua_isstring(L, -1)) { + if (lua_type(L, -2) != LUA_TSTRING || !lua_isstring(L, -1)) { return luaL_argerror(L, 3, "invalid environment"); } lua_pushfstring(L, "%s=%s", lua_tostring(L, -2), lua_tostring(L, -1)); - lua_insert(L, 4); + lua_insert(L, 5); lua_pop(L, 1); argn++; } @@ -80,8 +80,8 @@ int nixio__exec(lua_State *L, int m) { char **env = lua_newuserdata(L, sizeof(char*) * (argn + 1)); env[argn] = NULL; - for (i = 1; i < argn; i++) { - env[i-1] = (char *)lua_tostring(L, -i); + for (i = 1; i <= argn; i++) { + env[i-1] = (char *)lua_tostring(L, -(i+1)); } execve(path, args, env); |