- bool isdir = !!(gs_findDataStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
-
- if (isdir && !(flags & wxDIR))
- return wxFindNextFile();
- else if (!isdir && flags && !(flags & wxFILE))
- return wxFindNextFile();
-
- result += gs_findDataStruct.cFileName;
-
- return result;
-#else
- int flag = _A_NORMAL;
- if (flags & wxDIR) /* MATTHEW: [5] Use & */
- flag = _A_SUBDIR;
-
-#ifdef __BORLANDC__
- if (findfirst(WXSTRINGCAST spec, &gs_findDataStruct, flag) == 0)
-#else
- if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
-#endif
- {
- /* MATTHEW: [5] Check directory flag */
- char attrib;
-
-#ifdef __BORLANDC__
- attrib = gs_findDataStruct.ff_attrib;
-#else
- attrib = gs_findDataStruct.attrib;
-#endif
-
- if (attrib & _A_SUBDIR) {
- if (!(gs_findFlags & wxDIR))
- return wxFindNextFile();
- } else if (gs_findFlags && !(gs_findFlags & wxFILE))
- return wxFindNextFile();
-
- result +=
-#ifdef __BORLANDC__
- gs_findDataStruct.ff_name
-#else
- gs_findDataStruct.name
-#endif
- ;
- }
-#endif // __WIN32__
-
- return result;