[NOTEPAD] Simplify FileExists function (#5079)

Simplify FileExists helper function by using GetFileAttributes function. CORE-18837
This commit is contained in:
Katayama Hirofumi MZ 2023-02-18 21:40:11 +09:00 committed by GitHub
parent ebc69d089f
commit 504bf68e2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,13 +228,7 @@ static void AlertPrintError(void)
*/
BOOL FileExists(LPCTSTR szFilename)
{
WIN32_FIND_DATA entry;
HANDLE hFile;
hFile = FindFirstFile(szFilename, &entry);
FindClose(hFile);
return (hFile != INVALID_HANDLE_VALUE);
return GetFileAttributes(szFilename) != INVALID_FILE_ATTRIBUTES;
}
BOOL HasFileExtension(LPCTSTR szFilename)