From 98fbe3b09a338b3be5076240e1ea33509bce265d Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 24 Nov 2023 16:42:45 -0500 Subject: [PATCH] fix(lua): crash in nlua_error Backport fix hidden in bd4ff0b88, by actually using the `msg` parameter, rather than trying to print a potentially null `str`. --- src/nvim/lua/executor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 5c1ba3f9fc..72fcf6e43d 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -135,8 +135,8 @@ static void nlua_error(lua_State *const lstate, const char *const msg) } if (in_script) { - os_errmsg(str); - os_errmsg("\n"); + fprintf(stderr, msg, (int)len, str); + fprintf(stderr, "\n"); } else { msg_ext_set_kind("lua_error"); semsg_multiline(msg, (int)len, str);