From: Francesco M. <f18...@ya...> - 2006-05-18 10:30:12
|
Ray Gilbert ha scritto: > Being able to set LUA_PATH from within lua script is does not work with 5.1 > > I hacked code to look for LUA_PATH in our version of loadlib.c - but it only uses it for pname of "path" i.e. .lua files. > > You could change loadlib.c code to > > /* Make 5.0 compatible to allow global LUA_PATH to be set from LUA */ > if (strcmp(pname, "path") == 0 || strcmp(pname, "cpath") == 0) { > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > lua_getfield(L, LUA_GLOBALSINDEX, LUA_PATH); > > > so that it will pick up "cpath" libraries thanks for the tip but I'd prefer not to modify the loadlib.c code - specially because I've solved this problem with package.cpath ;) BTW, why was this LUA_PATH change added ? It would be great if we could use the verbatim lua 5.1 distribution in modules/lua... Thanks! Francesco |