From c22451f7f7f259bf224d00758c4f929d84cc1f23 Mon Sep 17 00:00:00 2001 From: Gustavo Carreno Date: Sat, 30 Dec 2023 08:04:25 +0000 Subject: [PATCH] fix: Remove double `/` and load errors --- src/serverprotocol/PasLS.LazConfig.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/serverprotocol/PasLS.LazConfig.pas b/src/serverprotocol/PasLS.LazConfig.pas index dab2187..ed75d00 100644 --- a/src/serverprotocol/PasLS.LazConfig.pas +++ b/src/serverprotocol/PasLS.LazConfig.pas @@ -966,7 +966,8 @@ procedure TLazProjectConfig.GuessCodeToolConfig; begin Doc := nil; try - FN:=Dir + DirectorySeparator + 'environmentoptions.xml'; + // This way we ensure we don't have 2 backslashes on the path + FN:= IncludeTrailingPathDelimiter(Dir) + 'environmentoptions.xml'; if FileExists(FN) and LoadLazConfig(FN) then begin EnvironmentOptions := Root.FindNode('EnvironmentOptions'); @@ -984,7 +985,10 @@ procedure TLazProjectConfig.GuessCodeToolConfig; FreeAndNil(Doc); end; try - if LoadLazConfig(Dir + DirectorySeparator + 'fpcdefines.xml') then + // This way we ensure we don't have 2 backslashes on the path + FN:= IncludeTrailingPathDelimiter(Dir) + 'fpcdefines.xml'; + // Before this change, there were a lot of errors reported + if FileExists(FN) and LoadLazConfig(FN) then begin FPCConfigs := Root.FindNode('FPCConfigs'); Item1 := nil;