summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorparai <[email protected]>2017-12-28 13:36:33 +0800
committerGitHub <[email protected]>2017-12-28 13:36:33 +0800
commiteade1bbd0f0eed96743b5b75c4c7b3ff09521ff5 (patch)
tree90c7787c1bb3ff85e78244583cec12710f1b1f0b /components/dfs
parentea608778aaf5eff1b9f2edc6e87c00b5388e4d58 (diff)
[dfs] fix the issue of stat "/.." of lwext4
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/src/dfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index 51aa777484..858399fd13 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -404,6 +404,13 @@ up_one:
if ((dst != fullpath) && (*dst == '/'))
*dst = '\0';
+ /* final check fullpath is not empty, for the special path of lwext "/.." */
+ if ('\0' == fullpath[0])
+ {
+ fullpath[0] = '/';
+ fullpath[1] = '\0';
+ }
+
return fullpath;
}
RTM_EXPORT(dfs_normalize_path);