Skip to content

Commit 89944d8

Browse files
committed
support LUA_DLL to load lua dylib
1 parent d3fbc5d commit 89944d8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/if_lua.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,16 @@ lua_link_init(char *libname, int verbose)
384384
int
385385
lua_enabled(int verbose)
386386
{
387-
return lua_link_init(DYNAMIC_LUA_DLL, verbose) == OK;
387+
int ret = FAIL;
388+
int mustfree = FALSE;
389+
char *s = (char *)vim_getenv((char_u *)"LUA_DLL", &mustfree);
390+
if (s != NULL)
391+
ret = lua_link_init(s, verbose);
392+
if (mustfree)
393+
vim_free(s);
394+
if (ret == FAIL)
395+
ret = lua_link_init(DYNAMIC_LUA_DLL, verbose);
396+
return (ret == OK);
388397
}
389398

390399
#endif /* DYNAMIC_LUA */

0 commit comments

Comments
 (0)