mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 13:33:26 +00:00
add lj_need_transform_path
This commit is contained in:
parent
a3ce7c53cb
commit
a893073d7f
@ -776,7 +776,7 @@ extern void *LJ_WIN_LOADLIBA(const char *path);
|
||||
#define LUAJIT_SECURITY_STRID 0
|
||||
#endif
|
||||
|
||||
#define LJ_DS_LOADBUFFER_PATCH 0
|
||||
#define LJ_DS_LOADBUFFER_PATCH 1
|
||||
#ifndef LJ_DS_LOADBUFFER_PATCH
|
||||
#define LJ_DS_LOADBUFFER_PATCH LJ_DS
|
||||
#endif
|
||||
|
@ -224,13 +224,14 @@ LUALIB_API int luaL_loadbufferx(lua_State *L, const char *buf, size_t size,
|
||||
|
||||
#if LJ_DS_LOADBUFFER_PATCH
|
||||
LUA_DATA_API const char* (*lj_path_map)(const char* k) = NULL;
|
||||
LUA_DATA_API int (*lj_need_transform_path)() = NULL;
|
||||
#endif
|
||||
|
||||
LUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size,
|
||||
const char *name)
|
||||
{
|
||||
#if LJ_DS_LOADBUFFER_PATCH
|
||||
if (buf != name){
|
||||
if (buf != name && lj_need_transform_path()){
|
||||
if (name[0] != '@'){
|
||||
if (lj_path_map){
|
||||
const char* real_path = lj_path_map(name);
|
||||
|
Loading…
Reference in New Issue
Block a user