mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:39:30 +02:00
lazutils: added MergeWithDelimiter
git-svn-id: branches/fixes_1_8@54757 -
This commit is contained in:
parent
f97577cb14
commit
f0e96331b8
@ -1240,13 +1240,8 @@ begin
|
||||
// normal unit name
|
||||
|
||||
if Pos('.',AUnitName)<1 then begin
|
||||
// generic unit -> search with namespaces first
|
||||
NameSpaces:=Strings[ctdcsNamespaces];
|
||||
if AddNameSpaces<>'' then begin
|
||||
if NameSpaces<>'' then NameSpaces:=NameSpaces+';';
|
||||
NameSpaces:=NameSpaces+AddNameSpaces;
|
||||
end;
|
||||
|
||||
// generic unit -> search with namespaces
|
||||
NameSpaces:=MergeWithDelimiter(Strings[ctdcsNamespaces],AddNameSpaces,';');
|
||||
if NameSpaces<>'' then begin
|
||||
// search with additional namespaces, separated by semicolon
|
||||
//debugln(['TCTDirectoryCache.FindUnitSourceInCompletePath NameSpaces="',NameSpaces,'"']);
|
||||
|
@ -29,6 +29,7 @@ function HasDelimitedItem(const List: string; Delimiter: char; FindItem: string
|
||||
): boolean;
|
||||
function FindNextDelimitedItem(const List: string; Delimiter: char;
|
||||
var Position: integer; FindItem: string): string;
|
||||
function MergeWithDelimiter(const a, b: string; Delimiter: char): string;
|
||||
|
||||
implementation
|
||||
|
||||
@ -145,5 +146,16 @@ begin
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
function MergeWithDelimiter(const a, b: string; Delimiter: char): string;
|
||||
begin
|
||||
if a<>'' then begin
|
||||
if b<>'' then
|
||||
Result:=a+Delimiter+b
|
||||
else
|
||||
Result:=b;
|
||||
end else
|
||||
Result:=b;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user