1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-02-08 07:17:14 +01:00

Backport Squirrel changes.

This commit is contained in:
Sandu Liviu Catalin
2020-03-20 20:50:17 +02:00
parent 60c53a5d0e
commit 8da1d76453
4 changed files with 18 additions and 4 deletions

View File

@@ -181,7 +181,7 @@ static SQInteger _string_printf(HSQUIRRELVM v)
return -1;
SQPRINTFUNCTION printfunc = sq_getprintfunc(v);
if(printfunc) printfunc(v,dest);
if(printfunc) printfunc(v,_SC("%s"),dest);
return 0;
}

View File

@@ -19,6 +19,10 @@
#define scremove remove
#define screname rename
#endif
#ifdef IOS
#include <spawn.h>
extern char **environ;
#endif
static SQInteger _system_getenv(HSQUIRRELVM v)
{
@@ -35,7 +39,13 @@ static SQInteger _system_system(HSQUIRRELVM v)
{
const SQChar *s;
if(SQ_SUCCEEDED(sq_getstring(v,2,&s))){
#ifdef IOS
pid_t pid;
posix_spawn(&pid, s, NULL, NULL, NULL, environ);
sq_pushinteger(v, 0);
#else
sq_pushinteger(v,scsystem(s));
#endif
return 1;
}
return sq_throwerror(v,_SC("wrong param"));