mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-02 11:19:28 +00:00
Create empty argv table when no args are passed to a Lua script
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11559 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
ce0fc12824
commit
a701745e0d
@ -156,7 +156,14 @@ static int lua_parse_and_execute(lua_State * L, char *input_code)
|
||||
error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1);
|
||||
switch_safe_free(code);
|
||||
}
|
||||
} else {
|
||||
// Force empty argv table
|
||||
char *code = NULL;
|
||||
code = switch_mprintf("argv = {};");
|
||||
error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1);
|
||||
switch_safe_free(code);
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
char *file = input_code, *fdup = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user