]> git.saurik.com Git - wxWidgets.git/commitdiff
don't call wxLogLastError() in wx{File|Path}Exists
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Jan 2002 13:17:07 +0000 (13:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 28 Jan 2002 13:17:07 +0000 (13:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filefn.cpp

index 422be2a5f86844e73c0c101f1ad92b81529cd700..cfc915390c33b623e5b02dcca81900c062cb9611 100644 (file)
@@ -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;