160 prosody.full_sessions = full_sessions; |
160 prosody.full_sessions = full_sessions; |
161 prosody.hosts = hosts; |
161 prosody.hosts = hosts; |
162 |
162 |
163 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, |
163 prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, |
164 plugins = CFG_PLUGINDIR, data = CFG_DATADIR }; |
164 plugins = CFG_PLUGINDIR, data = CFG_DATADIR }; |
|
165 |
|
166 local path_sep = package.config:sub(1,1); |
|
167 local rel_path_start = ".."..path_sep; |
|
168 function prosody.resolve_relative_path(path) |
|
169 if path then |
|
170 local is_relative; |
|
171 if path_sep == "/" and path:sub(1,1) ~= "/" then |
|
172 is_relative = true; |
|
173 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and path:sub(2,3) ~= ":\\") then |
|
174 is_relative = true; |
|
175 end |
|
176 if is_relative then |
|
177 return CFG_CONFIGDIR..path_sep..path; |
|
178 end |
|
179 end |
|
180 return path; |
|
181 end |
165 |
182 |
166 prosody.arg = _G.arg; |
183 prosody.arg = _G.arg; |
167 |
184 |
168 prosody.platform = "unknown"; |
185 prosody.platform = "unknown"; |
169 if os.getenv("WINDIR") then |
186 if os.getenv("WINDIR") then |