Avoid macros luaL_loadbuffer and luaL_loadfile

Use luaL_loadbufferx and luaL_loadfilex instead, being explicit about
whether to accept binary chunks.
This commit is contained in:
Roberto I
2026-04-07 13:42:34 -03:00
parent c037162a1a
commit 29cf284089
6 changed files with 17 additions and 15 deletions

View File

@@ -541,7 +541,7 @@ static int searcher_Lua (lua_State *L) {
const char *name = luaL_checkstring(L, 1);
filename = findfile(L, name, "path", LUA_LSUBSEP);
if (filename == NULL) return 1; /* module not found in this path */
return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename);
return checkload(L, (luaL_loadfilex(L, filename, "bt") == LUA_OK), filename);
}