aboutsummaryrefslogtreecommitdiff
path: root/src/lib_os.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_os.c')
-rw-r--r--src/lib_os.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib_os.c b/src/lib_os.c
index a3c951ba..e968d5d5 100644
--- a/src/lib_os.c
+++ b/src/lib_os.c
@@ -47,7 +47,11 @@ static int os_pushresult(lua_State *L, int i, const char *filename)
47 47
48LJLIB_CF(os_execute) 48LJLIB_CF(os_execute)
49{ 49{
50#if LJ_TARGET_CONSOLE
51 lua_pushinteger(L, -1);
52#else
50 lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); 53 lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
54#endif
51 return 1; 55 return 1;
52} 56}
53 57
@@ -86,7 +90,11 @@ LJLIB_CF(os_tmpname)
86 90
87LJLIB_CF(os_getenv) 91LJLIB_CF(os_getenv)
88{ 92{
93#if LJ_TARGET_CONSOLE
94 lua_pushnil(L);
95#else
89 lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ 96 lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */
97#endif
90 return 1; 98 return 1;
91} 99}
92 100