mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
pbx_lua: Add support for Lua 5.2
This adds support for Lua 5.2 in pbx_lua which is available on newer operating systems. (closes issue ASTERISK-23011) Review: https://reviewboard.asterisk.org/r/3075/ Reported by: George Joseph Patch by: George Joseph ........ Merged revisions 405090 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@405091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -873,8 +873,11 @@ static int lua_sort_extensions(lua_State *L)
|
||||
* table in the extensions_order table */
|
||||
for (lua_pushnil(L); lua_next(L, context); lua_pop(L, 1)) {
|
||||
int exten = lua_gettop(L) - 1;
|
||||
|
||||
#if LUA_VERSION_NUM < 502
|
||||
lua_pushinteger(L, lua_objlen(L, context_order) + 1);
|
||||
#else
|
||||
lua_pushinteger(L, lua_rawlen(L, context_order) + 1);
|
||||
#endif
|
||||
lua_pushvalue(L, exten);
|
||||
lua_settable(L, context_order);
|
||||
}
|
||||
@@ -1506,9 +1509,13 @@ static int lua_find_extension(lua_State *L, const char *context, const char *ext
|
||||
lua_remove(L, -2); /* remove the extensions order table */
|
||||
|
||||
context_order_table = lua_gettop(L);
|
||||
|
||||
|
||||
/* step through the extensions looking for a match */
|
||||
#if LUA_VERSION_NUM < 502
|
||||
for (i = 1; i < lua_objlen(L, context_order_table) + 1; i++) {
|
||||
#else
|
||||
for (i = 1; i < lua_rawlen(L, context_order_table) + 1; i++) {
|
||||
#endif
|
||||
int e_index_copy, match = 0;
|
||||
const char *e;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user