Mercurial > prosody-hg
comparison core/configmanager.lua @ 4358:86be454168fb
configmanager: resolve_relative_path: Improved detection of absolute paths on Windows.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 25 Aug 2011 12:07:36 +0500 |
| parents | 2e8411f6cb14 |
| children | 40905e7bf680 |
comparison
equal
deleted
inserted
replaced
| 4357:d6928b78c548 | 4358:86be454168fb |
|---|---|
| 86 path = path:gsub("^%.%"..path_sep.."+", ""); | 86 path = path:gsub("^%.%"..path_sep.."+", ""); |
| 87 | 87 |
| 88 local is_relative; | 88 local is_relative; |
| 89 if path_sep == "/" and path:sub(1,1) ~= "/" then | 89 if path_sep == "/" and path:sub(1,1) ~= "/" then |
| 90 is_relative = true; | 90 is_relative = true; |
| 91 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and path:sub(2,3) ~= ":\\") then | 91 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and (path:sub(2,3) ~= ":\\" or path:sub(2,3) ~= ":/")) then |
| 92 is_relative = true; | 92 is_relative = true; |
| 93 end | 93 end |
| 94 if is_relative then | 94 if is_relative then |
| 95 return parent_path..path_sep..path; | 95 return parent_path..path_sep..path; |
| 96 end | 96 end |
