+readability, hopefully
This commit is contained in:
parent
2df363747b
commit
af22a6a824
|
@ -285,9 +285,9 @@ end
|
||||||
|
|
||||||
|
|
||||||
function common.relative_path(ref_dir, dir)
|
function common.relative_path(ref_dir, dir)
|
||||||
if #ref_dir>2 and ref_dir:sub(2,2)==':'
|
local drive_pattern = "^(%a):\\"
|
||||||
and #dir>2 and dir:sub(2,2)==':'
|
local drive, ref_drive = dir:match(drive_pattern), ref_dir:match(drive_pattern)
|
||||||
and ref_dir:sub(1,1)~=dir:sub(1,1) then
|
if drive and ref_drive and drive ~= ref_drive then
|
||||||
-- Windows, different drives, system.absolute_path fails for C:\..\D:\
|
-- Windows, different drives, system.absolute_path fails for C:\..\D:\
|
||||||
return dir
|
return dir
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue