Merge pull request #569 from www220/fix-15-10-12-1

[DFS] 修正romfs在输入的目录名称比实际的名称短时存在的判断错误
This commit is contained in:
Bernard Xiong 2015-10-14 10:32:54 +08:00
commit 6680a6b57f
1 changed files with 2 additions and 1 deletions

View File

@ -96,7 +96,8 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch
{ {
if (check_dirent(&dirent[index]) != 0) if (check_dirent(&dirent[index]) != 0)
return RT_NULL; return RT_NULL;
if (rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0) if (rt_strlen(dirent[index].name) == (subpath_end - subpath) &&
rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0)
{ {
dirent_size = dirent[index].size; dirent_size = dirent[index].size;