I had occasion to use nixio.exece() recently and I could not figure out what it wanted for the third argument (the environment) as no matter what sort of table I passed, even nixio.getenv(), would fail with bad argument #3 to 'exece' (invalid environment). What it should expect is a table full of string values for keys and something that can be converted to a string as a value, however it inverts the value of lua_type() and compares it against a type, which will never evaluate to true. Getting past this, the code inserts the KEY=VALUE string before the arg userdata, and then forgets to take the env userdata into account when collecting the arguments back into a C char**. This patch addresses all these issues and provides a working nixio.exece(). [Fixes #500] |
||
---|---|---|
.. | ||
axTLS | ||
axtls-config | ||
axtls-root/etc/nixio | ||
docsrc | ||
lua | ||
root/lib/upgrade | ||
src | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
nixio-0.3-1.rockspec | ||
NOTICE | ||
README | ||
standalone.mk |
Building: Use GNU Make. make or gmake depending on your system. Special make flags: OS Override Target OS [Linux|FreeBSD|SunOS|Windows] NIXIO_TLS TLS-Library [*openssl|axtls] NIXIO_CROSS_CC MinGW CC (Windows) `which i586-mingw32msvc-cc` LUA_CFLAGS Lua CFLAGS `pkg-config --cflags lua5.1` LUA_TARGET Lua compile target [*source|strip|compile] LUA_MODULEDIR Install LUA_PATH "/usr/share/lua/5.1" LUA_LIBRARYDIR Install LUA_CPATH "/usr/lib/lua/5.1"