Skip to content

Commit 9ac0358

Browse files
committed
FileSystem: Fix fileEquals for symlinks
1 parent b958ada commit 9ac0358

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libsync/filesystem.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ namespace OCC {
3131
bool FileSystem::fileEquals(const QString &fn1, const QString &fn2)
3232
{
3333
// compare two files with given filename and return true if they have the same content
34+
auto symlinkTargetFile1 = readlink(fn1);
35+
auto symlinkTargetFile2 = readlink(fn2);
36+
if (!symlinkTargetFile1.isEmpty() && symlinkTargetFile1 == symlinkTargetFile2) {
37+
return true;
38+
}
3439
QFile f1(fn1);
3540
QFile f2(fn2);
3641
if (!f1.open(QIODevice::ReadOnly) || !f2.open(QIODevice::ReadOnly)) {

0 commit comments

Comments
 (0)