mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 09:20:23 +02:00
LazUtils: in CopyDirTree() add a PathDelim to both SourceDir and TarGetDir before testing wether TarGetDir is a subdirectory of SourceDir. Issue #0038644.
git-svn-id: trunk@64845 -
This commit is contained in:
parent
32d3a2159b
commit
966ee04907
@ -331,10 +331,11 @@ begin
|
||||
Searcher.FTargetDir:=TrimFilename(SetDirSeparators(TargetDir));
|
||||
|
||||
// Don't even try to copy to a subdirectory of SourceDir.
|
||||
//append a pathedelim, otherwise CopyDirTree('/home/user/foo','/home/user/foobar') will fail at this point. Issue #0038644
|
||||
{$ifdef CaseInsensitiveFilenames}
|
||||
if AnsiStartsText(Searcher.FSourceDir, Searcher.FTargetDir) then Exit;
|
||||
if AnsiStartsText(AppendPathDelim(Searcher.FSourceDir), AppendPathDelim(Searcher.FTargetDir)) then Exit;
|
||||
{$ELSE}
|
||||
if AnsiStartsStr(Searcher.FSourceDir, Searcher.FTargetDir) then Exit;
|
||||
if AnsiStartsStr(AppendPathDelim(Searcher.FSourceDir), AppendPathDelim(Searcher.FTargetDir)) then Exit;
|
||||
{$ENDIF}
|
||||
Searcher.Search(SourceDir);
|
||||
Result:=Searcher.FCopyFailedCount=0;
|
||||
|
Loading…
Reference in New Issue
Block a user