mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
Merge bb1ad21df0 into 54d6654ad1
This commit is contained in:
commit
0bd9657692
1 changed files with 26 additions and 1 deletions
|
|
@ -543,6 +543,30 @@ end;
|
|||
procedure TFileSyncRec.UpdateState(ignoreDate: Boolean);
|
||||
var
|
||||
FileTimeDiff: Integer;
|
||||
|
||||
function AreEquivalentLinks: Boolean;
|
||||
var
|
||||
LeftTarget, RightTarget: String;
|
||||
LeftResolved, RightResolved: String;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
if not (FFileL.IsLink and FFileR.IsLink) then Exit;
|
||||
|
||||
LeftTarget := FFileL.LinkProperty.LinkTo;
|
||||
RightTarget := FFileR.LinkProperty.LinkTo;
|
||||
|
||||
// Fast path: identical link text means semantically identical link.
|
||||
if LeftTarget = RightTarget then Exit(True);
|
||||
|
||||
if (LeftTarget = EmptyStr) or (RightTarget = EmptyStr) then Exit;
|
||||
|
||||
// Also accept different textual forms that resolve to the same target.
|
||||
LeftResolved := GetAbsoluteFileName(FFileL.Path, LeftTarget);
|
||||
RightResolved := GetAbsoluteFileName(FFileR.Path, RightTarget);
|
||||
|
||||
Result := mbCompareFileNames(LeftResolved, RightResolved);
|
||||
end;
|
||||
begin
|
||||
FState := srsNotEq;
|
||||
if Assigned(FFileR) and not Assigned(FFileL) then
|
||||
|
|
@ -552,7 +576,8 @@ begin
|
|||
FState := srsCopyRight
|
||||
else begin
|
||||
FileTimeDiff := FileTimeCompare(FFileL.ModificationTime, FFileR.ModificationTime, FForm.FNtfsShift);
|
||||
if ((FileTimeDiff = 0) or ignoreDate) and (FFileL.Size = FFileR.Size) then
|
||||
if ((FileTimeDiff = 0) or ignoreDate) and
|
||||
((FFileL.Size = FFileR.Size) or AreEquivalentLinks) then
|
||||
FState := srsEqual
|
||||
else
|
||||
if not ignoreDate then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue