- wxFileSpec = spec;
- wxFindFileFlags = flags; /* MATTHEW: [5] Remember flags */
-
- // Find path only so we can concatenate
- // found file onto path
- wxString path1(wxFileSpec);
- char *p = wxPathOnly(WXSTRINGCAST path1);
- if (p && (strlen(p) > 0))
- strcpy(wxBuffer, p);
- else
- wxBuffer[0] = 0;
-
-#ifdef __WIN32__
- if (wxFileStrucHandle != INVALID_HANDLE_VALUE)
- FindClose(wxFileStrucHandle);
-
- wxFileStrucHandle = ::FindFirstFile(WXSTRINGCAST spec, &wxFileStruc);
-
- if (wxFileStrucHandle == INVALID_HANDLE_VALUE)
- return NULL;
-
- bool isdir = !!(wxFileStruc.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
-
- if (isdir && !(flags & wxDIR))
- return wxFindNextFile();
- else if (!isdir && flags && !(flags & wxFILE))
- return wxFindNextFile();
-
- if (wxBuffer[0] != 0)
- strcat(wxBuffer, "\\");
- strcat(wxBuffer, wxFileStruc.cFileName);
- return wxBuffer;
-#else
-
- int flag = _A_NORMAL;
- if (flags & wxDIR) /* MATTHEW: [5] Use & */
- flag = _A_SUBDIR;
-
-#ifdef __BORLANDC__
- if (findfirst(WXSTRINGCAST spec, &wxFileStruc, flag) == 0)
-#else
- if (_dos_findfirst(WXSTRINGCAST spec, flag, &wxFileStruc) == 0)
-#endif
- {
- /* MATTHEW: [5] Check directory flag */
- char attrib;
-
-#ifdef __BORLANDC__
- attrib = wxFileStruc.ff_attrib;
+ if (!buf)
+ buf = new wxChar[sz+1];
+#if wxUSE_UNICODE
+ char *cbuf = new char[sz+1];
+#ifdef _MSC_VER
+ if (_getcwd(cbuf, sz) == NULL) {
+#elif defined(__WXMAC__) && !defined(__DARWIN__)
+ enum
+ {
+ SFSaveDisk = 0x214, CurDirStore = 0x398
+ };
+ FSSpec cwdSpec ;
+
+ FSMakeFSSpec( - *(short *) SFSaveDisk , *(long *) CurDirStore , NULL , &cwdSpec ) ;
+ wxString res = wxMacFSSpec2UnixFilename( &cwdSpec ) ;
+ strcpy( buf , res ) ;
+ if (0) {