59 end |
59 end |
60 |
60 |
61 local LUA_DIRSEP = package.config:sub(1,1); |
61 local LUA_DIRSEP = package.config:sub(1,1); |
62 local LUA_PATH_MARK = package.config:sub(5,5); |
62 local LUA_PATH_MARK = package.config:sub(5,5); |
63 |
63 |
64 local base_path = files[1]:match("^(.-)"..LUA_DIRSEP.."[^"..LUA_DIRSEP.."]*$").."/"; |
64 local base_path = (files[1]:match("^(.-)"..LUA_DIRSEP.."[^"..LUA_DIRSEP.."]*$") or ".").."/"; |
65 |
65 |
66 local package_path = package.path:gsub("[^;]+", function (path) |
66 local package_path = package.path:gsub("[^;]+", function (path) |
67 if not path:match("^%"..LUA_DIRSEP) then |
67 if not path:match("^%"..LUA_DIRSEP) then |
68 return base_path..path; |
68 return base_path..path; |
69 end |
69 end |