mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 04:19:09 +02:00
Merged revision(s) 64845 #966ee04907 from trunk:
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: branches/fixes_2_0@64894 -
This commit is contained in:
parent
4d2d7125fd
commit
71b130e9da
@ -325,10 +325,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