#ifdef __GNUWIN32__
#include <sys/unistd.h>
-// #include <sys/stat.h>
-
-#ifndef __MINGW32__
-#include <std.h>
-#endif
-
#define stricmp strcasecmp
#endif
bool
wxFileExists (const wxString& filename)
{
+#ifdef __GNUWIN32__ // (fix a B20 bug)
+ if (GetFileAttributes(filename) == 0xFFFFFFFF)
+ return FALSE;
+ else
+ return TRUE;
+#else
struct stat stbuf;
if (filename && stat ((char *)(const char *)filename, &stbuf) == 0)
return TRUE;
return FALSE;
+#endif
}
/* Vadim's alternative implementation
return FALSE;
};
-
+bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
#ifdef HAVE_FNMATCH_H
{
- // dot_special: what is it supposed to do?
- return fnmatch(pat.c_str(), text.c_str(), FNM_PERIOD) == 0;
+ if(dot_special)
+ return fnmatch(pat.c_str(), text.c_str(), FNM_PERIOD) == 0;
+ else
+ return fnmatch(pat.c_str(), text.c_str(), 0) == 0;
}
#else
/*
* WARNING: this code is broken!
*/
-bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
{
wxString tmp1 = pat;
char *pattern = WXSTRINGCAST(tmp1);