Commit 9318c154 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

contrib: lua: Do not use system nor popen on winrt

Again, forbidden functions. One could argue that we don't want
os.execute on any platform though.
parent bd6deb1a
......@@ -48,6 +48,10 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
$(APPLY) $(SRC)/lua/no-dylibs.patch
$(APPLY) $(SRC)/lua/no-localeconv.patch
$(APPLY) $(SRC)/lua/lua-android-log2.patch
ifdef HAVE_WINRT
$(APPLY) $(SRC)/lua/winrt-nopopen.patch
$(APPLY) $(SRC)/lua/winrt-nosystem.patch
endif
ifdef HAVE_DARWIN_OS
(cd $(UNPACK_DIR) && \
sed -e 's%gcc%$(CC)%' \
......
--- lua/src/liolib.c.orig 2016-04-06 13:42:39.215028405 +0200
+++ lua/src/liolib.c 2016-04-06 13:48:24.006744226 +0200
@@ -58,11 +58,6 @@
#define l_popen(L,c,m) (fflush(NULL), popen(c,m))
#define l_pclose(L,file) (pclose(file))
-#elif defined(LUA_USE_WINDOWS) /* }{ */
-
-#define l_popen(L,c,m) (_popen(c,m))
-#define l_pclose(L,file) (_pclose(file))
-
#else /* }{ */
/* ISO C definitions */
--- lua/src/loslib.c.orig 2016-04-06 14:04:30.614773245 +0200
+++ lua/src/loslib.c 2016-04-06 14:05:40.694941331 +0200
@@ -127,18 +127,6 @@
-static int os_execute (lua_State *L) {
- const char *cmd = luaL_optstring(L, 1, NULL);
- int stat = system(cmd);
- if (cmd != NULL)
- return luaL_execresult(L, stat);
- else {
- lua_pushboolean(L, stat); /* true if there is a shell */
- return 1;
- }
-}
-
-
static int os_remove (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
return luaL_fileresult(L, remove(filename) == 0, filename);
@@ -366,7 +354,6 @@
{"clock", os_clock},
{"date", os_date},
{"difftime", os_difftime},
- {"execute", os_execute},
{"exit", os_exit},
{"getenv", os_getenv},
{"remove", os_remove},
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment