X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c04857dd6a69272399054f4e7fac47d46bf8b09f..60d43ad883f16c458928fa7e4e1dbb96f492e77a:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 11de9801ba..4bbe6747d1 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1336,7 +1336,10 @@ wxString wxFindFirstFile(const wxChar *spec, int flags) wxString result; gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags); if ( result.IsEmpty() ) + { wxDELETE(gs_dir); + return result; + } return gs_dirPath + result; } @@ -1349,7 +1352,10 @@ wxString wxFindNextFile() gs_dir->GetNext(&result); if ( result.IsEmpty() ) + { wxDELETE(gs_dir); + return result; + } return gs_dirPath + result; } @@ -1439,6 +1445,14 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) delete [] cbuf; } #endif + +#ifdef __DJGPP__ + // VS: DJGPP is a strange mix of DOS and UNIX API and returns paths with + // / deliminers. We don't like that. + for (wxChar *ch = buf; *ch; ch++) + if (*ch == wxT('/')) *ch = wxT('\\'); +#endif + return buf; } @@ -1750,3 +1764,28 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) #ifdef __VISUALC__ #pragma warning(default:4706) // assignment within conditional expression #endif // VC++ + +//------------------------------------------------------------------------ +// Missing functions in Unicode for Win9x +//------------------------------------------------------------------------ + +// NB: MSLU only covers Win32 API, it doesn't provide Unicode implementation of +// libc functions. Unfortunately, some of MSVCRT wchar_t functions +// (e.g. _wopen) don't work on Windows 9x, so we have to workaround it +// by calling the char version. We still want to use wchar_t version on +// NT/2000/XP, though, because they allow for Unicode file names. +#if wxUSE_UNICODE_MSLU + + #if defined( __VISUALC__ ) \ + || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) + WXDLLEXPORT int wxOpen(const wxChar *name, int flags, int mode) + { + if ( wxGetOsVersion() == wxWINDOWS_NT ) + return _wopen(name, flags, mode); + else + return _open(wxConvFile.cWX2MB(name), flags, mode); + } + #endif + +#endif // wxUSE_UNICODE_MSLU