回收站恢复无后缀文件出错

issue: https://gitee.com/openharmony/filemanagement_user_file_service/issues/I94HCZ
Signed-off-by: hunili <lihucheng2@huawei.com>
This commit is contained in:
hunili 2024-02-28 17:07:18 +08:00
parent b0ec8c8641
commit 24b614f52e

View File

@ -270,7 +270,7 @@ static int MoveFile(const string &srcFile, const string &destFile)
size_t suffixPos = destFile.find_last_of('.');
string filePathName = " ";
string fileSuffix = "";
if (suffixPos < slashPos) {
if (suffixPos == std::string::npos || suffixPos < slashPos) {
// 识别的文件后缀分隔符必须在文件部分
filePathName = destFile + filePathName;
} else {