[Pkg-owncloud-commits] [owncloud-client] 28/164: SyncFileItem::operator<: must return false when two items are equal

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:55:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 193fca4a8b28118d037ba687371b016ca6507766
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Feb 17 18:22:22 2015 +0100

    SyncFileItem::operator<: must return false when two items are equal
    
    Fixes #2852
---
 src/libsync/syncfileitem.h | 4 ++--
 test/testsyncfileitem.h    | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h
index 2fdc0db..9c8e25f 100644
--- a/src/libsync/syncfileitem.h
+++ b/src/libsync/syncfileitem.h
@@ -80,10 +80,10 @@ public:
         auto minSize = std::min(d1.size(), d2.size());
         while (prefixL < minSize && data1[prefixL] == data2[prefixL]) { prefixL++; }
 
-        if (prefixL == d1.size())
-            return true;
         if (prefixL == d2.size())
             return false;
+        if (prefixL == d1.size())
+            return true;
 
         if (data1[prefixL] == '/')
             return true;
diff --git a/test/testsyncfileitem.h b/test/testsyncfileitem.h
index 59ba88f..5fa062f 100644
--- a/test/testsyncfileitem.h
+++ b/test/testsyncfileitem.h
@@ -61,6 +61,10 @@ private slots:
         QVERIFY(!(b < a));
         QVERIFY(!(c < b));
         QVERIFY(!(c < a));
+
+        QVERIFY(!(a < a));
+        QVERIFY(!(b < b));
+        QVERIFY(!(c < c));
     }
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list