diff options
author | Mike Pall <mike> | 2012-06-09 20:54:34 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-06-09 20:54:34 +0200 |
commit | 37be8a54785b893f531679adb0b479a426938504 (patch) | |
tree | 933b0320e158361c69fa5f4332247d201eb02187 /src/lib_os.c | |
parent | 9f443e8b8919e094100bf1eb94981aec905be783 (diff) | |
download | luajit-37be8a54785b893f531679adb0b479a426938504.tar.gz luajit-37be8a54785b893f531679adb0b479a426938504.tar.bz2 luajit-37be8a54785b893f531679adb0b479a426938504.zip |
CONSOLE: Handle unimplemented features for console toolchains.
Diffstat (limited to 'src/lib_os.c')
-rw-r--r-- | src/lib_os.c | 8 |
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 | ||
48 | LJLIB_CF(os_execute) | 48 | LJLIB_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 | ||
87 | LJLIB_CF(os_getenv) | 91 | LJLIB_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 | ||