Просмотр исходного кода

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

Alexander Koblov 3 лет назад
Родитель
Сommit
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;
   OldName:= aFile.FullPath;
 
 
   if FileSource.GetPathType(NewName) <> ptAbsolute then
   if FileSource.GetPathType(NewName) <> ptAbsolute then
-    NewName := ExtractFilePath(OldName) + NewName;
+  begin
+    NewName := ExtractFilePath(OldName) + TrimPath(NewName);
+  end;
 
 
   if OldName = NewName then
   if OldName = NewName then
     Exit(sfprSkipped);
     Exit(sfprSkipped);