More disciplined use of 'getstr' and 'tsslen'
We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
This commit is contained in:
4
lapi.c
4
lapi.c
@@ -417,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
|
||||
o = index2value(L, idx); /* previous call may reallocate the stack */
|
||||
}
|
||||
if (len != NULL)
|
||||
*len = vslen(o);
|
||||
*len = tsslen(tsvalue(o));
|
||||
lua_unlock(L);
|
||||
return svalue(o);
|
||||
return getstr(tsvalue(o));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user