1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

[scripting] lua_rawlen. Refs #46

This commit is contained in:
Witold Filipczyk 2020-05-22 20:46:35 +02:00
parent e20ed163cb
commit 9e71d7f3c8

View File

@ -144,8 +144,11 @@ script_hook_pre_format_html(va_list ap, void *data)
if (err) return EVENT_HOOK_STATUS_NEXT;
if (lua_isstring(L, -1)) {
#if LUA_VERSION_NUM > 501
int len = lua_rawlen(L, -1);
#else
int len = lua_strlen(L, -1);
#endif
add_fragment(cached, 0, (unsigned char *) lua_tostring(L, -1), len);
normalize_cache_entry(cached, len);
} else if (!lua_isnil(L, -1)) {