Comparison

core/configmanager.lua @ 5811:27ae988f5b70

configmanager: Fix checking of absolute paths on Windows
author Kim Alvefur <zash@zash.se>
date Fri, 30 Aug 2013 18:51:55 +0200
parent 5413:0bf5e90be086
child 5814:5cf1c08805fb
child 6166:46cb87d531a7
comparison
equal deleted inserted replaced
5810:99ad8d42d0c9 5811:27ae988f5b70
75 path = path:gsub("^%.%"..path_sep.."+", ""); 75 path = path:gsub("^%.%"..path_sep.."+", "");
76 76
77 local is_relative; 77 local is_relative;
78 if path_sep == "/" and path:sub(1,1) ~= "/" then 78 if path_sep == "/" and path:sub(1,1) ~= "/" then
79 is_relative = true; 79 is_relative = true;
80 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and (path:sub(2,3) ~= ":\\" or path:sub(2,3) ~= ":/")) then 80 elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and (path:sub(2,3) ~= ":\\" and path:sub(2,3) ~= ":/")) then
81 is_relative = true; 81 is_relative = true;
82 end 82 end
83 if is_relative then 83 if is_relative then
84 return parent_path..path_sep..path; 84 return parent_path..path_sep..path;
85 end 85 end