From 17493e89a7410f2345a393bd1cd5a7ae28bf9543 Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Mon, 13 Jul 2020 22:49:37 +0200 Subject: [PATCH] trying to fix building against lua 5.4 --- auto.def | 4 ++-- mutt_lua.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auto.def b/auto.def index a75e099aaa9..d992fb7b1ba 100644 --- a/auto.def +++ b/auto.def @@ -586,12 +586,12 @@ if {[get-define want-testing]} { if {[get-define want-lua]} { if {[get-define want-pkgconf]} { - if {![pkgconf false lua] && ![pkgconf false lua-5.3] && ![pkgconf false lua-5.2]} { + if {![pkgconf false lua] && ![pkgconf false lua-5.4] && ![pkgconf false lua-5.3] && ![pkgconf false lua-5.2]} { user-error "Unable to find LUA" } define USE_LUA } else { - set lua_versions { 5.3 5.2 } ;# Will be checked in order + set lua_versions { 5.4 5.3 5.2 } ;# Will be checked in order apply {{lua_prefix lua_versions} { foreach ver $lua_versions { diff --git a/mutt_lua.c b/mutt_lua.c index a9d1629a22a..ed1aef5ce86 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -178,7 +178,7 @@ static int lua_mutt_set(lua_State *l) case DT_STRING: { const char *value = lua_tostring(l, -1); - size_t val_size = lua_strlen(l, -1); + size_t val_size = lua_rawlen(l, -1); struct Buffer value_buf = mutt_buffer_make(val_size); mutt_buffer_strcpy_n(&value_buf, value, val_size); if (DTYPE(he->type) == DT_PATH)