瀏覽代碼

ADD: Don't allow rename file to the name with a dot at the end (Windows)

Alexander Koblov 3 年之前
父節點
當前提交
811266e6c3
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/filesources/filesystem/ufilesystemsetfilepropertyoperation.pas

+ 3 - 1
src/filesources/filesystem/ufilesystemsetfilepropertyoperation.pas

@@ -330,7 +330,9 @@ begin
   OldName:= aFile.FullPath;
 
   if FileSource.GetPathType(NewName) <> ptAbsolute then
-    NewName := ExtractFilePath(OldName) + NewName;
+  begin
+    NewName := ExtractFilePath(OldName) + TrimPath(NewName);
+  end;
 
   if OldName = NewName then
     Exit(sfprSkipped);