diff options
Diffstat (limited to 'apps/plugins/lua/rocklib.c')
-rw-r--r-- | apps/plugins/lua/rocklib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 9ad6411b2f..426dd079af 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #define LUA_LIB | 25 | #define LUA_LIB |
26 | 26 | ||
27 | #include "lua.h" | 27 | #include "lua.h" |
28 | #include "lstring.h" | ||
28 | 29 | ||
29 | #include "lauxlib.h" | 30 | #include "lauxlib.h" |
30 | #include "rocklib.h" | 31 | #include "rocklib.h" |
@@ -835,6 +836,7 @@ LUALIB_API int luaopen_rock(lua_State *L) | |||
835 | static const struct lua_int_reg* rlci = rlib_const_int; | 836 | static const struct lua_int_reg* rlci = rlib_const_int; |
836 | for (; rlci->name; rlci++) { | 837 | for (; rlci->name; rlci++) { |
837 | lua_pushinteger(L, rlci->value); | 838 | lua_pushinteger(L, rlci->value); |
839 | luaS_newlloc(L, rlci->name, TSTR_INBIN); | ||
838 | lua_setfield(L, -2, rlci->name); | 840 | lua_setfield(L, -2, rlci->name); |
839 | } | 841 | } |
840 | 842 | ||
@@ -853,7 +855,9 @@ LUALIB_API int luaopen_rock(lua_State *L) | |||
853 | 855 | ||
854 | static const struct lua_str_reg* rlcs = rlib_const_str; | 856 | static const struct lua_str_reg* rlcs = rlib_const_str; |
855 | for (; rlcs->name; rlcs++) { | 857 | for (; rlcs->name; rlcs++) { |
858 | luaS_newlloc(L, rlcs->value, TSTR_INBIN); | ||
856 | lua_pushstring(L, rlcs->value); | 859 | lua_pushstring(L, rlcs->value); |
860 | luaS_newlloc(L, rlcs->name, TSTR_INBIN); | ||
857 | lua_setfield(L, -2, rlcs->name); | 861 | lua_setfield(L, -2, rlcs->name); |
858 | } | 862 | } |
859 | 863 | ||