LazUtils: Use trimmed paths for comparing sub-dir in CopyDirTree. Fix return value. Issue #28841.

git-svn-id: trunk@51034 -
This commit is contained in:
juha 2015-12-25 19:14:04 +00:00
parent 6faa4e893c
commit d10faafb1a

View File

@ -708,11 +708,10 @@ begin
Searcher.FTargetDir:=TrimFilename(SetDirSeparators(TargetDir));
// Don't even try to copy to a subdirectory of SourceDir.
if {$if defined(Windows) or defined(darwin)}AnsiStartsText{$ELSE}AnsiStartsStr{$ENDIF}
(SourceDir, TargetDir) then Exit;
(Searcher.FSourceDir, Searcher.FTargetDir) then Exit;
Searcher.Search(SourceDir);
Result:=True;
finally
Result:=Searcher.FCopyFailedCount=0;
finally
Searcher.Free;
end;
end;