X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f177c8e7309c8cf3ece1563870d135cc8f0e6a1..097aeb99031e36e4306926d652e4bcccda8b71cb:/src/msw/dir.cpp diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index 2ed4f0e02e..adfa2dd7e3 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -28,6 +28,11 @@ #pragma hdrstop #endif +// For _A_SUBDIR, etc. +#if defined(__BORLANDC__) && defined(__WIN16__) +#include +#endif + #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" @@ -149,7 +154,7 @@ static inline FIND_DATA FindFirst(const wxString& spec, FIND_STRUCT *finddata) { - return ::FindFirstFile(filespec, &finddata); + return ::FindFirstFile(spec, finddata); } static inline bool FindNext(FIND_DATA fd, FIND_STRUCT *finddata) @@ -267,9 +272,12 @@ bool wxDirData::Read(wxString *filename) if ( !IsFindDataOk(m_finddata) ) { // open first - wxString filespec; - filespec << m_dirname << _T('\\') - << (!m_filespec ? _T("*.*") : m_filespec.c_str()); + wxString filespec = m_dirname; + if ( !wxEndsWithPathSeparator(filespec) ) + { + filespec += _T('\\'); + } + filespec += (!m_filespec ? _T("*.*") : m_filespec.c_str()); m_finddata = FindFirst(filespec, PTR_TO_FINDDATA);