Merge pull request #1146 from parai/patch-2

[dfs] fix the issue of stat "/.." of lwext4
This commit is contained in:
Bernard Xiong 2017-12-28 14:17:59 +08:00 committed by GitHub
commit 813919b675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -404,6 +404,13 @@ up_one:
if ((dst != fullpath) && (*dst == '/')) if ((dst != fullpath) && (*dst == '/'))
*dst = '\0'; *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; return fullpath;
} }
RTM_EXPORT(dfs_normalize_path); RTM_EXPORT(dfs_normalize_path);