X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e1c7236e0a3a827553271f2ef624995b44db58c..b39fc8d7b1b853cb15f39d51617214b7b90a8872:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index e8c8fda943..3c5764a6bb 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -175,9 +175,12 @@ public: if ( m_hFile == INVALID_HANDLE_VALUE ) { - wxLogSysError(_("Failed to open '%s' for %s"), - filename.c_str(), - mode == Read ? _("reading") : _("writing")); + if ( mode == Read ) + wxLogSysError(_("Failed to open '%s' for reading"), + filename.c_str()); + else + wxLogSysError(_("Failed to open '%s' for writing"), + filename.c_str()); } } @@ -2328,14 +2331,11 @@ wxULongLong wxFileName::GetSize(const wxString &filename) DWORD lpFileSizeHigh; DWORD ret = GetFileSize(f, &lpFileSizeHigh); - if (ret == INVALID_FILE_SIZE) + if ( ret == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR ) return wxInvalidSize; - // compose the low-order and high-order byte sizes - return wxULongLong(ret | (lpFileSizeHigh << sizeof(WORD)*2)); - -#else // ! __WIN32__ - + return wxULongLong(lpFileSizeHigh, ret); +#else // ! __WIN32__ wxStructStat st; #ifndef wxNEED_WX_UNISTD_H if (wxStat( filename.fn_str() , &st) != 0)