+ // skip path separator in the beginning of the file name if present
+ if ( wxIsPathSeparator(*basename) )
+ basename++;
+
+ wxStringTokenizer tokenizer(path, wxPATH_SEP);
+ while ( tokenizer.HasMoreTokens() )
+ {
+ wxString strFile = tokenizer.GetNextToken();
+ if ( !wxEndsWithPathSeparator(strFile) )
+ strFile += wxFILE_SEP_PATH;
+ strFile += basename;
+
+ wxFSFile *file = OpenFile(strFile);
+ if ( file )
+ {
+ delete file;
+ *pStr = strFile;
+ return true;
+ }
+ }
+
+ return false;
+}