From: Vadim Zeitlin Date: Mon, 28 Jan 2002 13:17:07 +0000 (+0000) Subject: don't call wxLogLastError() in wx{File|Path}Exists X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a28ae4096bb21302ce2ad59ca846ce590f8488bf don't call wxLogLastError() in wx{File|Path}Exists git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 422be2a5f8..cfc915390c 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -302,14 +302,8 @@ wxFileExists (const wxString& filename) #if defined(__WIN32__) && !defined(__WXMICROWIN__) // GetFileAttributes can copy with network paths unlike stat() DWORD ret = ::GetFileAttributes(filename); - if ( ret == (DWORD)-1 ) - { - wxLogLastError(_T("GetFileAttributes")); - - return FALSE; - } - return !(ret & FILE_ATTRIBUTE_DIRECTORY); + return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY); #else wxStructStat stbuf; if ( !filename.empty() && wxStat (OS_FILENAME(filename), &stbuf) == 0 ) @@ -1284,14 +1278,8 @@ bool wxPathExists(const wxChar *pszPathName) #if defined(__WIN32__) && !defined(__WXMICROWIN__) // stat() can't cope with network paths DWORD ret = ::GetFileAttributes(strPath); - if ( ret == (DWORD)-1 ) - { - wxLogLastError(_T("GetFileAttributes")); - - return FALSE; - } - return (ret & FILE_ATTRIBUTE_DIRECTORY) != 0; + return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY); #else // !__WIN32__ wxStructStat st;