From 17895f3a30bf44469e183af7860333a5918ef9f0 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 19 Jan 2016 09:58:00 +0100 Subject: [PATCH] Win: Fix filesystem detection for exFAT workaround #2701 --- src/libsync/filesystem.cpp | 5 +++-- src/libsync/syncjournaldb.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 3cd2781cf..09fd16826 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -476,9 +476,10 @@ bool FileSystem::fileExists(const QString& filename, const QFileInfo& fileInfo) QString FileSystem::fileSystemForPath(const QString & path) { // See also QStorageInfo (Qt >=5.4) and GetVolumeInformationByHandleW (>= Vista) - QString drive = path.left(3); - if (! drive.endsWith(":\\")) + QString drive = path.left(2); + if (! drive.endsWith(":")) return QString(); + drive.append('\\'); const size_t fileSystemBufferSize = 4096; TCHAR fileSystemBuffer[fileSystemBufferSize]; diff --git a/src/libsync/syncjournaldb.cpp b/src/libsync/syncjournaldb.cpp index 1fa8c54c9..d492efa07 100644 --- a/src/libsync/syncjournaldb.cpp +++ b/src/libsync/syncjournaldb.cpp @@ -112,8 +112,9 @@ static QString defaultJournalMode(const QString & dbPath) // See #2693: Some exFAT file systems seem unable to cope with the // WAL journaling mode. They work fine with DELETE. QString fileSystem = FileSystem::fileSystemForPath(dbPath); + qDebug() << "Detected filesystem" << fileSystem << "for" << dbPath; if (fileSystem.contains("FAT")) { - qDebug() << "Detected filesystem" << fileSystem << "- using DELETE journal mode"; + qDebug() << "Filesystem contains FAT - using DELETE journal mode"; return "DELETE"; } #else -- 2.30.2