diff options
| author | [email protected] <[email protected]> | 2010-11-30 14:19:12 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2010-11-30 14:19:12 +0000 |
| commit | 753de2064321e558268ba046d1dea5add52ac6e2 (patch) | |
| tree | 0861cd1d2adb81a2f0bcf56bc528f939effb844d | |
| parent | 400c012e4d08cb470ad290b48100cdccb5f2838e (diff) | |
fix dfs_filesystem_lookup issue in empty item.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1162 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | components/dfs/src/dfs_fs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index f6e7867578..d1e62468f1 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -88,8 +88,12 @@ struct dfs_filesystem* dfs_filesystem_lookup(const char *path) /* lookup it in the filesystem table */
for (index = 0; index < DFS_FILESYSTEMS_MAX + 1; index++)
{
- fspath = strlen(filesystem_table[index].path);
- if (fspath < prefixlen) continue;
+ if (filesystem_table[index].path == RT_NULL) continue;
+ else
+ {
+ fspath = strlen(filesystem_table[index].path);
+ if (fspath < prefixlen) continue;
+ }
if ((filesystem_table[index].ops != RT_NULL) &&
strncmp(filesystem_table[index].path, path, fspath) == 0)
|
