Skip to content

Commit

Permalink
Synchronized path.h/path.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
caibinwav123456 committed Jan 14, 2022
1 parent 9056172 commit 7c34af0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions misc/unittest/unittest/fs_sh/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ DLLAPI(void) concat_path(const string& path1, const string& path2, string& merge
path_array1.insert(path_array1.end(),path_array2.begin(),path_array2.end());
merge_path(merge, path_array1,dsym);
}
DLLAPI(bool) is_subpath(const string& relative_path1, const string& relative_path2)
DLLAPI(bool) is_subpath(const string& relative_path1, const string& relative_path2, char dsym)
{
return relative_path1.size()>relative_path2.size()&&relative_path1.substr(0,relative_path2.size())==relative_path2;
return relative_path1.size()>relative_path2.size()
&&relative_path1.substr(0,relative_path2.size())==relative_path2
&&relative_path1[relative_path2.size()]==dsym;
}
2 changes: 1 addition & 1 deletion misc/unittest/unittest/fs_sh/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ int get_absolute_path(const string& cur_dir, const vector<string>& relative_path
int get_absolute_path(const string& cur_dir, const string& relative_path, vector<string>& absolute_path, char dsym=_dir_symbol);
DLLAPI(int) get_absolute_path(const string& cur_dir, const string& relative_path, string& absolute_path, int (*is_absolute_path)(char* path, char dsym)=NULL, char dsym=_dir_symbol);
DLLAPI(void) concat_path(const string& path1, const string& path2, string& merge, char dsym=_dir_symbol);
DLLAPI(bool) is_subpath(const string& relative_path1, const string& relative_path2);
DLLAPI(bool) is_subpath(const string& relative_path1, const string& relative_path2, char dsym=_dir_symbol);
#endif

0 comments on commit 7c34af0

Please sign in to comment.