这几个PATH处理函数有错误吗
int path_depth(const char* path, bool bfolder)
{
char temp [MAX_PATH] = {0};
strcpy(temp, path);
int temp_len = strlen(temp);
if (bfolder && temp[temp_len-1] != '\\')
strcat(temp, "\\");
int n = 0;
const char* p = temp;
while (p = strchr(p, '\\')) {
p++;
n++;
}
return n;
}
char* path_remove_filespec(char* path)
{
PathRemoveFileSpec(path);
return path;
}
string path_get_filespec(const char* path)
{
char* p = strrchr(path, '\\');
if (!p)
return path;
else
return p+1;
}