#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if !defined(__WATCOMC__)
+#if !wxONLY_WATCOM_EARLIER_THAN(1,4)
#if !(defined(_MSC_VER) && (_MSC_VER > 800))
#include <errno.h>
#endif
wxString wxPathList::FindValidPath (const wxString& file)
{
- if (wxFileExists (wxExpandPath(wxFileFunctionsBuffer, file)))
- return wxString(wxFileFunctionsBuffer);
+ wxExpandPath(wxFileFunctionsBuffer, file);
wxChar buf[_MAXPATHLEN];
wxStrcpy(buf, wxFileFunctionsBuffer);
#else // !__WIN32__
wxStructStat st;
#ifndef wxNEED_WX_UNISTD_H
- return wxStat( filename.fn_str() , &st) == 0 && (st.st_mode & S_IFREG);
+ return (wxStat( filename.fn_str() , &st) == 0 && (st.st_mode & S_IFREG))
+#ifdef __OS2__
+ || (errno == EACCES) // if access is denied something with that name
+ // exists and is opened in exclusive mode.
+#endif
+ ;
#else
return wxStat( filename , &st) == 0 && (st.st_mode & S_IFREG);
#endif