bool FTPCache::IsPathPrefixLocal(const TCHAR * localpath, const TCHAR * prefix, const TCHAR ** postfix) const { int commonsize = PathCommonPrefix(localpath, prefix, NULL); int prefixsize = lstrlen(prefix); if (commonsize != prefixsize) return false; *postfix = localpath+prefixsize; return true; /* while(*prefix != 0) { if (*localpath == 0) return false; if (*localpath != *prefix) return false; localpath++; prefix++; } *postfix = localpath; return true; */ }
CFilePath CFilePath::GetCommonPrefix(LPCTSTR psSecondPath) { CString psPrefix; PathCommonPrefix(msPath, psSecondPath, CStringLock(psPrefix, msPath.GetLength())); return CFilePath(psPrefix, 0); }