diff options
| author | Bernard Xiong <[email protected]> | 2015-10-14 11:08:04 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-10-14 11:08:04 +0800 |
| commit | c5fd1aaf5f89e6bcafc620c4dc7be5cb2f42d6d5 (patch) | |
| tree | d7ff5e839d20383c53a804f13a4f8d2e7d58155f /components | |
| parent | 1086f6cfa03330a7afc87830e8e9a36a4db554a4 (diff) | |
| parent | 6680a6b57ffada87ddd5756fb2228e6afc176a96 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/filesystems/romfs/dfs_romfs.c | 3 | ||||
| -rw-r--r-- | components/finsh/msh_cmd.c | 2 | ||||
| -rw-r--r-- | components/finsh/shell.c | 2 |
3 files changed, 4 insertions, 3 deletions
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; diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index 19eb5e0b72..a4b865b028 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -234,7 +234,7 @@ int cmd_mkfs(int argc, char **argv) if (strcmp(argv[1], "-t") == 0) { type = argv[2]; - result = dfs_mkfs(type, argv[1]); + result = dfs_mkfs(type, argv[3]); } } else diff --git a/components/finsh/shell.c b/components/finsh/shell.c index ce80e4dec2..8962a7333f 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -425,7 +425,7 @@ void finsh_thread_entry(void *parameter) if (rt_device_read(shell->device, 0, &next, 1) == 1) { - if (next == '\0') ch = 'r'; /* linux telnet will issue '\0' */ + if (next == '\0') ch = '\r'; /* linux telnet will issue '\0' */ else ch = next; } else ch = '\r'; |
