CONSOLE: Handle unimplemented features for console toolchains.
This commit is contained in:
@@ -47,7 +47,11 @@ static int os_pushresult(lua_State *L, int i, const char *filename)
|
||||
|
||||
LJLIB_CF(os_execute)
|
||||
{
|
||||
#if LJ_TARGET_CONSOLE
|
||||
lua_pushinteger(L, -1);
|
||||
#else
|
||||
lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -86,7 +90,11 @@ LJLIB_CF(os_tmpname)
|
||||
|
||||
LJLIB_CF(os_getenv)
|
||||
{
|
||||
#if LJ_TARGET_CONSOLE
|
||||
lua_pushnil(L);
|
||||
#else
|
||||
lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user