diff options
Diffstat (limited to 'apps/plugins/lua/lobject.c')
| -rw-r--r-- | apps/plugins/lua/lobject.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/plugins/lua/lobject.c b/apps/plugins/lua/lobject.c index a351ff4..65a23cf 100644 --- a/apps/plugins/lua/lobject.c +++ b/apps/plugins/lua/lobject.c @@ -107,6 +107,21 @@ static void pushstr (lua_State *L, const char *str) { } +/* ROCKLUA ADDED -- Retrieves C string from TString */ +const char *luaO_getstring(const TString * ts){ + const char *string; +#ifdef INBINARYSTRINGS + if (testbits((ts)->tsv.type, TSTR_INBIN)) + string = *(cast(const char **, (ts) + 1)); + else +#else + if (true) +#endif + string = cast(const char *, (ts) + 1); + return string; +} + + /* this function handles only `%d', `%c', %f, %p, and `%s' formats */ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { int n = 1; |