fix workspace folders on different drives in Windows

This commit is contained in:
ep 2021-07-22 15:32:22 +07:00 committed by Francesco
parent 0a0bc87319
commit 2df363747b
1 changed files with 6 additions and 0 deletions

View File

@ -285,6 +285,12 @@ end
function common.relative_path(ref_dir, dir)
if #ref_dir>2 and ref_dir:sub(2,2)==':'
and #dir>2 and dir:sub(2,2)==':'
and ref_dir:sub(1,1)~=dir:sub(1,1) then
-- Windows, different drives, system.absolute_path fails for C:\..\D:\
return dir
end
local ref_ls = split_on_slash(ref_dir)
local dir_ls = split_on_slash(dir)
local i = 1