From b053cf9e2a987a3d554a2b047a60c2f8dfb9a716 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 3 Dec 2021 11:43:45 +0100 Subject: [PATCH] do not forget the path when renaming files with invalid names Signed-off-by: Matthieu Gallien --- src/libsync/discovery.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 8d16c6f0a8565..f67967025cc6e 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -389,7 +389,13 @@ void ProcessDirectoryJob::processFile(PathTuple path, item->_originalFile = path._original; item->_previousSize = dbEntry._fileSize; item->_previousModtime = dbEntry._modtime; - item->_renameTarget = localEntry.renameName; + if (!localEntry.renameName.isEmpty()) { + if (_dirItem) { + item->_renameTarget = _dirItem->_file + "/" + localEntry.renameName; + } else { + item->_renameTarget = localEntry.renameName; + } + } if (dbEntry._modtime == localEntry.modtime && dbEntry._type == ItemTypeVirtualFile && localEntry.type == ItemTypeFile) { item->_type = ItemTypeFile;