mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[scripting] lua_rawlen. Refs #46
This commit is contained in:
parent
e20ed163cb
commit
9e71d7f3c8
@ -144,8 +144,11 @@ script_hook_pre_format_html(va_list ap, void *data)
|
|||||||
if (err) return EVENT_HOOK_STATUS_NEXT;
|
if (err) return EVENT_HOOK_STATUS_NEXT;
|
||||||
|
|
||||||
if (lua_isstring(L, -1)) {
|
if (lua_isstring(L, -1)) {
|
||||||
|
#if LUA_VERSION_NUM > 501
|
||||||
|
int len = lua_rawlen(L, -1);
|
||||||
|
#else
|
||||||
int len = lua_strlen(L, -1);
|
int len = lua_strlen(L, -1);
|
||||||
|
#endif
|
||||||
add_fragment(cached, 0, (unsigned char *) lua_tostring(L, -1), len);
|
add_fragment(cached, 0, (unsigned char *) lua_tostring(L, -1), len);
|
||||||
normalize_cache_entry(cached, len);
|
normalize_cache_entry(cached, len);
|
||||||
} else if (!lua_isnil(L, -1)) {
|
} else if (!lua_isnil(L, -1)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user