SyncEngine: Ensure that the paths passed to the discovery ends with slashes
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 18 Dec 2018 09:38:39 +0000 (10:38 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:28 +0000 (10:58 +0100)
This was making the tx.pl test fail

src/libsync/syncengine.cpp

index 1a96ed6578d42bb5dee753e1a006f8fa7b73312d..418d494fcd1c4b8b39a9f6f1ebf0bdeceb7d61e0 100644 (file)
@@ -579,7 +579,11 @@ void SyncEngine::slotStartDiscovery()
     _discoveryPhase->_excludes = _excludedFiles.data();
     _discoveryPhase->_statedb = _journal;
     _discoveryPhase->_localDir = _localPath;
+    if (!_discoveryPhase->_localDir.endsWith('/'))
+        _discoveryPhase->_localDir+='/';
     _discoveryPhase->_remoteFolder = _remotePath;
+    if (!_discoveryPhase->_remoteFolder.endsWith('/'))
+        _discoveryPhase->_remoteFolder+='/';
     _discoveryPhase->_syncOptions = _syncOptions;
     _discoveryPhase->_shouldDiscoverLocaly = [this](const QString &s) { return shouldDiscoverLocally(s); };
     _discoveryPhase->_selectiveSyncBlackList = selectiveSyncBlackList;