From 6f35e069d6e3e177ac349efc345c07bcd22da762 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 1 Oct 2002 15:45:53 +0000 Subject: [PATCH] small fixes for debugger without file git-svn-id: trunk@3423 - --- ide/ideprocs.pp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ide/ideprocs.pp b/ide/ideprocs.pp index 4ad49671e3..3f13eb3f17 100644 --- a/ide/ideprocs.pp +++ b/ide/ideprocs.pp @@ -98,6 +98,7 @@ function FilenameIsPascalUnit(const Filename: string): boolean; function FilenameIsPascalSource(const Filename: string): boolean; function FilenameIsFormText(const Filename: string): boolean; function MergeSearchPaths(const OldSearchPath, AddSearchPath: string): string; +function RemoveSearchPaths(const SearchPath, RemoveSearchPath: string): string; function GetNextDirectoryInSearchPath(const SearchPath: string; var NextStartPos: integer): string; function SearchDirectoryInSearchPath(const SearchPath, Directory: string; @@ -302,6 +303,44 @@ begin end; end; +function RemoveSearchPaths(const SearchPath, RemoveSearchPath: string): string; +var + OldPathLen: Integer; + EndPos: Integer; + StartPos: Integer; + ResultStartPos: Integer; +begin + Result:=SearchPath; + OldPathLen:=length(SearchPath); + EndPos:=1; + ResultStartPos:=1; + repeat + StartPos:=EndPos; + while (StartPos<=OldPathLen) and (SearchPath[StartPos]=';') do + inc(StartPos); + if StartPos>OldPathLen then break; + EndPos:=StartPos; + while (EndPos<=OldPathLen) and (SearchPath[EndPos]<>';') do + inc(EndPos); + if SearchDirectoryInSearchPath(RemoveSearchPath,SearchPath,StartPos)>0 then + begin + // remove path -> skip + end else begin + // keep path -> copy + if ResultStartPos>1 then begin + Result[ResultStartPos]:=';'; + inc(ResultStartPos); + end; + while StartPos