Skip to content

Commit

Permalink
Fix a critical forgotten error
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Nov 10, 2023
1 parent 4736eb5 commit 6794a04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PowerEditor/src/MISC/Common/FileInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Win32_IO_File::Win32_IO_File(const wchar_t *fname)
FindClose(hFind);
}

_hFile = ::CreateFileW(fname, _accessParam, _shareParam, NULL, dispParam, _attribParam, NULL);

// Race condition management:
// If file didn't exist while calling PathFileExistsW, but before calling CreateFileW, file is created: use CREATE_ALWAYS is OK
// If file did exist while calling PathFileExistsW, but before calling CreateFileW, file is deleted: use TRUNCATE_EXISTING will cause the error
Expand Down

0 comments on commit 6794a04

Please sign in to comment.