- // we assume that it's not empty
- wxCHECK_MSG( !IsEmpty(pszFile), FALSE,
- _("empty file name in wxFindFileInPath"));
-
- // skip path separator in the beginning of the file name if present
- if ( wxIsPathSeparator(*pszFile) )
- pszFile++;
-
- // copy the path (strtok will modify it)
- char *szPath = new char[strlen(pszPath) + 1];
- strcpy(szPath, pszPath);
-
- wxString strFile;
- char *pc;
- for ( pc = strtok(szPath, wxPATH_SEP);
- pc != NULL;
- pc = strtok((char *) NULL, wxPATH_SEP) )
- {
- // search for the file in this directory
- strFile = pc;
- if ( !wxEndsWithPathSeparator(pc) )
- strFile += wxFILE_SEP_PATH;
- strFile += pszFile;
-
- if ( FileExists(strFile) ) {
- *pStr = strFile;
- break;
+ // we assume that it's not empty
+ wxCHECK_MSG( !wxIsEmpty(pszFile), FALSE,
+ _("empty file name in wxFindFileInPath"));
+
+ // skip path separator in the beginning of the file name if present
+ if ( wxIsPathSeparator(*pszFile) )
+ pszFile++;
+
+ // copy the path (strtok will modify it)
+ wxChar *szPath = new wxChar[wxStrlen(pszPath) + 1];
+ wxStrcpy(szPath, pszPath);
+
+ wxString strFile;
+ wxChar *pc, *save_ptr;
+ for ( pc = wxStrtok(szPath, wxPATH_SEP, &save_ptr);
+ pc != NULL;
+ pc = wxStrtok((wxChar *) NULL, wxPATH_SEP, &save_ptr) )
+ {
+ // search for the file in this directory
+ strFile = pc;
+ if ( !wxEndsWithPathSeparator(pc) )
+ strFile += wxFILE_SEP_PATH;
+ strFile += pszFile;
+
+ if ( FileExists(strFile) ) {
+ *pStr = strFile;
+ break;
+ }