Merge pull request #4133 from RaiKoHoff/Dev_Master

Fix directory locking of current file.
This commit is contained in:
Pairi Daiza 2022-08-29 12:19:58 +02:00 committed by GitHub
commit 5a8a689d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10672,14 +10672,6 @@ bool FileLoad(const HPATHL hfile_pth, FileLoadFlags fLoadFlags)
Path_NormalizeEx(hopen_file, Paths.WorkingDirectory, true, Flags.bSearchPathIfRelative);
// change current directory to prevent directory lock on another path
HPATHL hdir_pth = Path_Copy(hopen_file);
Path_RemoveFileSpec(hdir_pth);
if (Path_IsExistingDirectory(hdir_pth)) {
SetCurrentDirectoryW(Path_Get(hdir_pth));
}
Path_Release(hdir_pth);
// Ask to create a new file...
if (!(fLoadFlags & FLF_Reload) && !Path_IsExistingFile(hopen_file)) {
bool bCreateFile = s_flagQuietCreate;