static inline const WCHAR* file_nameW(const WCHAR* str) { const WCHAR* p; for (p = str + strlenW(str) - 1; p >= str && !is_sepW(*p); p--); return p + 1; }
static inline void file_pathW(const WCHAR* srcFileNameW, WCHAR* dstFilePathW) { int len; for (len = strlenW(srcFileNameW) - 1; (len > 0) && (!is_sepW(srcFileNameW[len])); len--); strncpyW(dstFilePathW, srcFileNameW, len); dstFilePathW[len] = L'\0'; }
/****************************************************************** * SymMatchFileNameW (DBGHELP.@) * */ BOOL WINAPI SymMatchFileNameW(PCWSTR file, PCWSTR match, PWSTR* filestop, PWSTR* matchstop) { PCWSTR fptr; PCWSTR mptr; TRACE("(%s %s %p %p)\n", debugstr_w(file), debugstr_w(match), filestop, matchstop); fptr = file + strlenW(file) - 1; mptr = match + strlenW(match) - 1; while (fptr >= file && mptr >= match) { if (toupperW(*fptr) != toupperW(*mptr) && !(is_sepW(*fptr) && is_sepW(*mptr))) break; fptr--; mptr--; } if (filestop) *filestop = (PWSTR)fptr; if (matchstop) *matchstop = (PWSTR)mptr; return mptr == match - 1; }