From 504bf68e2a031b93fa612dcc56d036cc9430193e Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 18 Feb 2023 21:40:11 +0900 Subject: [PATCH] [NOTEPAD] Simplify FileExists function (#5079) Simplify FileExists helper function by using GetFileAttributes function. CORE-18837 --- base/applications/notepad/dialog.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/base/applications/notepad/dialog.c b/base/applications/notepad/dialog.c index bc692321417..0b76b4711fd 100644 --- a/base/applications/notepad/dialog.c +++ b/base/applications/notepad/dialog.c @@ -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)