mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 19:39:28 +02:00
LazUtils: Fix r51038 #10e166f60e for Issue #28841.
git-svn-id: trunk@51039 -
This commit is contained in:
parent
10e166f60e
commit
b8d42c3a62
@ -696,7 +696,8 @@ end;
|
|||||||
function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean;
|
function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean;
|
||||||
var
|
var
|
||||||
Searcher: TCopyDirTree;
|
Searcher: TCopyDirTree;
|
||||||
Dummy: String;
|
RelPath: String;
|
||||||
|
B: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=False;
|
Result:=False;
|
||||||
Searcher:=TCopyDirTree.Create;
|
Searcher:=TCopyDirTree.Create;
|
||||||
@ -709,8 +710,9 @@ begin
|
|||||||
Searcher.FTargetDir:=LazFileUtils.TrimFilename(SetDirSeparators(TargetDir));
|
Searcher.FTargetDir:=LazFileUtils.TrimFilename(SetDirSeparators(TargetDir));
|
||||||
|
|
||||||
// Don't even try to copy to a subdirectory of SourceDir.
|
// Don't even try to copy to a subdirectory of SourceDir.
|
||||||
if TryCreateRelativePath(LazFileUtils.ExpandFilenameUtf8(Searcher.FSourceDir),
|
B := TryCreateRelativePath(LazFileUtils.ExpandFilenameUtf8(Searcher.FSourceDir),
|
||||||
LazFileUtils.ExpandFilenameUtf8(Searcher.FTargetDir), False, True, {%H-}Dummy) then Exit;
|
LazFileUtils.ExpandFilenameUtf8(Searcher.FTargetDir), False, True, RelPath);
|
||||||
|
if B and not ((Copy(RelPath,1,2) <> '..') and (RelPath <> '')) then Exit;
|
||||||
|
|
||||||
Searcher.Search(SourceDir);
|
Searcher.Search(SourceDir);
|
||||||
Result:=Searcher.FCopyFailedCount=0;
|
Result:=Searcher.FCopyFailedCount=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user