Vfs suffix: Require suffix when creating placeholder files

This commit is contained in:
Christian Kamm 2019-03-29 09:36:45 +01:00 committed by Kevin Ottens
parent 3f55f9302e
commit 5e5b0b3f76
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -63,6 +63,11 @@ void VfsSuffix::createPlaceholder(const SyncFileItem &item)
{
// The concrete shape of the placeholder is also used in isDehydratedPlaceholder() below
QString fn = _setupParams.filesystemPath + item._file;
if (!fn.endsWith(fileSuffix())) {
ASSERT(false, "vfs file isn't ending with suffix");
return;
}
QFile file(fn);
file.open(QFile::ReadWrite | QFile::Truncate);
file.write(" ");