From 7915a315eedb208bc44d6754e235c3e43154db3d Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 13 Mar 2016 22:32:26 +0100 Subject: [PATCH] fix, DUB, rel importPaths problem --- src/ce_dubproject.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index 5da2ff72..cffb68e6 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -734,14 +734,21 @@ procedure TCEDubProject.updateImportPathsFromJson; var arr: TJSONArray; item: TJSONData; + pth: string; i: integer; begin item := obj.Find('importPaths'); if assigned(item) then begin arr := TJSONArray(item); - for i:= 0 to arr.Count-1 do - fImportPaths.Add(arr.Strings[i]); + for i := 0 to arr.Count-1 do + begin + pth := TrimRightSet(arr.Strings[i], ['/','\']); + if pth.dirExists and FilenameIsAbsolute(pth) then + fImportPaths.Add(pth) + else + fImportPaths.Add(expandFilenameEx(fBasePath, pth)); + end; end; end; // note: dependencies are added as import to allow DCD completion