Add last / to exclude list file path.
authorCamila <hello@camila.codes>
Fri, 2 Oct 2020 06:57:15 +0000 (08:57 +0200)
committerCamila <hello@camila.codes>
Thu, 26 Nov 2020 11:11:57 +0000 (12:11 +0100)
This Q_ASSERT(this->endsWith('/')) in BasePathByteArray was the reason
for bug report #1458.

Signed-off-by: Camila <hello@camila.codes>
src/csync/csync_exclude.cpp

index dadd611bfde5abf990064a786097eb131f420f3d..b34a521cf42bf26bbc0c3b867d470dc33ab90a18 100644 (file)
@@ -411,10 +411,12 @@ CSYNC_EXCLUDE_TYPE ExcludedFiles::traversalPatternMatch(const char *path, ItemTy
 
     // Directories are guaranteed to be visited before their files
     if (filetype == ItemTypeDirectory) {
-        QFileInfo fi = QFileInfo(_localPath + path + "/.sync-exclude.lst");
+        const auto basePath = QString(_localPath + path + QLatin1Char('/')).toUtf8();
+        const auto fi = QFileInfo(basePath + QStringLiteral(".sync-exclude.lst"));
+
         if (fi.isReadable()) {
             addInTreeExcludeFilePath(fi.absoluteFilePath());
-            loadExcludeFile(fi.absolutePath().toUtf8(), fi.absoluteFilePath());
+            loadExcludeFile(basePath, fi.absoluteFilePath());
         }
     }