浏览代码

fixup: merge condition

Shell 1 年之前
父节点
当前提交
91fc52df36
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      components/dfs/dfs_v1/src/dfs.c
  2. 1 1
      components/dfs/dfs_v2/src/dfs.c

+ 1 - 1
components/dfs/dfs_v1/src/dfs.c

@@ -759,7 +759,7 @@ up_one:
 
     /* remove '/' in the end of path if exist */
     dst--;
-    if (dst >= fullpath && (dst != fullpath) && (*dst == '/'))
+    if (dst > fullpath && (*dst == '/'))
         *dst = '\0';
 
     /* final check fullpath is not empty, for the special path of lwext "/.." */

+ 1 - 1
components/dfs/dfs_v2/src/dfs.c

@@ -668,7 +668,7 @@ char *dfs_normalize_path(const char *directory, const char *filename)
 
     /* remove '/' in the end of path if exist */
     dst--;
-    if (dst >= fullpath && (dst != fullpath) && (*dst == '/'))
+    if (dst > fullpath && (*dst == '/'))
         *dst = '\0';
 
     /* final check fullpath is not empty, for the special path of lwext "/.." */