+ // Do the reading
+ struct dirent *nextDir;
+ for ( nextDir = readdir(gs_dirStream);
+ nextDir != NULL;
+ nextDir = readdir(gs_dirStream) )
+ {
+ if (wxMatchWild(name, nextDir->d_name, FALSE) && // RR: added FALSE to find hidden files
+ strcmp(nextDir->d_name, ".") &&
+ strcmp(nextDir->d_name, "..") )
+ {
+ result.Empty();
+ if ( !path.IsEmpty() )
+ {
+ result = path;
+ if ( path != wxT('/') )
+ result += wxT('/');
+ }
+
+ result += nextDir->d_name;
+
+ // Only return "." and ".." when they match
+ bool isdir;
+ if ( (strcmp(nextDir->d_name, ".") == 0) ||
+ (strcmp(nextDir->d_name, "..") == 0))
+ {
+ if ( (gs_findFlags & wxDIR) != 0 )
+ isdir = TRUE;
+ else
+ continue;
+ }
+ else
+ isdir = wxDirExists(result);
+
+ // and only return directories when flags & wxDIR
+ if ( !gs_findFlags ||
+ ((gs_findFlags & wxDIR) && isdir) ||
+ ((gs_findFlags & wxFILE) && !isdir) )
+ {
+ return result;
+ }
+ }
+ }
+
+ result.Empty(); // not found
+
+ closedir(gs_dirStream);
+ gs_dirStream = (DIR *) NULL;
+#endif // !VMS6.2 or earlier
+
+ return result;