From: Mike Pall Date: Mon, 7 Apr 2025 08:27:40 +0000 (+0200) Subject: Fix error generation in load*. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e76bb50d44702f601ec5dd167b03b475ed53860c;p=thirdparty%2FLuaJIT.git Fix error generation in load*. Reported by Sergey Kaplun. #1353 --- diff --git a/src/lj_load.c b/src/lj_load.c index 90a61027..6c8ae9f1 100644 --- a/src/lj_load.c +++ b/src/lj_load.c @@ -108,8 +108,9 @@ LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename, copyTV(L, L->top-1, L->top); } if (err) { + const char *fname = filename ? filename : "stdin"; L->top--; - lua_pushfstring(L, "cannot read %s: %s", chunkname+1, strerror(err)); + lua_pushfstring(L, "cannot read %s: %s", fname, strerror(err)); return LUA_ERRFILE; } return status;