Skip to content

Commit

Permalink
修复lua54的ios版本,在某些版本的xcode编译不过的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Oct 14, 2020
1 parent 2f43b42 commit 00535a4
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions build/lua-5.4.1/src/loslib.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,17 @@



static int os_execute (lua_State *L) {
const char *cmd = luaL_optstring(L, 1, NULL);
int stat;
errno = 0;
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_execute (lua_State *L) {
// const char *cmd = luaL_optstring(L, 1, NULL);
// errno = 0;
// 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) {
Expand Down Expand Up @@ -408,7 +407,7 @@ static const luaL_Reg syslib[] = {
{"clock", os_clock},
{"date", os_date},
{"difftime", os_difftime},
{"execute", os_execute},
//{"execute", os_execute},
{"exit", os_exit},
{"getenv", os_getenv},
{"remove", os_remove},
Expand Down

0 comments on commit 00535a4

Please sign in to comment.