Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 88 of file misc.c.
Referenced by replace().
{ UINT i = 0; TCHAR TempPath[MAX_PATH]; WIN32_FIND_DATA FindFileData; HANDLE hFind; _tcscpy(TempPath, _T("")); _tcscpy(OutPath, _T("")); for(i = 0; i < _tcslen(Path); i++) { if(Path[i] != _T('\\')) { _tcsncat(TempPath, &Path[i], 1); if(i != _tcslen(Path) - 1) continue; } /* Handle the base part of the path different. Because if you put it into findfirstfile, it will return your current folder */ if(_tcslen(TempPath) == 2 && TempPath[1] == _T(':')) { _tcscat(OutPath, TempPath); _tcscat(OutPath, _T("\\")); _tcscat(TempPath, _T("\\")); } else { hFind = FindFirstFile(TempPath,&FindFileData); if(hFind == INVALID_HANDLE_VALUE) { _tcscpy(OutPath, Path); return; } _tcscat(TempPath, _T("\\")); _tcscat(OutPath, FindFileData.cFileName); _tcscat(OutPath, _T("\\")); FindClose(hFind); } } }