From 45d46b076fcb8d9c85ac31edac1120c01a43930b Mon Sep 17 00:00:00 2001 From: "www220@tom.com" Date: Wed, 14 Oct 2015 10:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3romfs=E5=9C=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E7=9B=AE=E5=BD=95=E5=90=8D=E7=A7=B0=E6=AF=94?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E7=9A=84=E5=90=8D=E7=A7=B0=E7=9F=AD=E6=97=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20=E6=AF=94=E5=A6=82=E5=AE=9E=E9=99=85=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=BAabcde=EF=BC=8Cmsh=E6=89=A7=E8=A1=8C=20cd=20abc?= =?UTF-8?q?=E4=B9=9F=E8=83=BD=E6=89=A7=E8=A1=8C=E6=88=90=E5=8A=9F=EF=BC=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=90=8D=E7=A7=B0=E6=97=B6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/filesystems/romfs/dfs_romfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index 1dd41b41eb..6110d61227 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -96,7 +96,8 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch { if (check_dirent(&dirent[index]) != 0) 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;