mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 19:02:05 +02:00
* skip empty path components in concatpaths, related to #40682
(cherry picked from commit 2ec99cc82e
)
This commit is contained in:
parent
15f377a60c
commit
9d39bcbdec
@ -510,12 +510,14 @@ function ConcatPaths(const Paths: array of PathStr): PathStr;
|
|||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := '';
|
||||||
if Length(Paths) > 0 then
|
if Length(Paths) > 0 then
|
||||||
begin
|
begin
|
||||||
|
if Paths[0]<>'' then
|
||||||
Result := Paths[0];
|
Result := Paths[0];
|
||||||
for I := 1 to Length(Paths) - 1 do
|
for I := 1 to Length(Paths) - 1 do
|
||||||
|
if Paths[i]<>'' then
|
||||||
Result := IncludeTrailingPathDelimiter(Result) + ExcludeLeadingPathDelimiter(Paths[I]);
|
Result := IncludeTrailingPathDelimiter(Result) + ExcludeLeadingPathDelimiter(Paths[I]);
|
||||||
end else
|
end
|
||||||
Result := '';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user