X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/96cf56ea15a22b8b362aac6c3ab202d2608e9151..290981180b9abc454e017271a8ebe75478c00e86:/lunaix-os/kernel/fs/path_walk.c diff --git a/lunaix-os/kernel/fs/path_walk.c b/lunaix-os/kernel/fs/path_walk.c index ea5b1c5..a0331e7 100644 --- a/lunaix-os/kernel/fs/path_walk.c +++ b/lunaix-os/kernel/fs/path_walk.c @@ -33,7 +33,10 @@ __vfs_walk(struct v_dnode* start, panick("vfs: no root"); } } - i++; + + if (path[0] == VFS_PATH_DELIM) { + i++; + } } assert(start); @@ -71,9 +74,7 @@ __vfs_walk(struct v_dnode* start, if (!lookahead && (walk_options & VFS_WALK_PARENT)) { if (component) { - component->hash = name.hash; - component->len = j; - strcpy(component->value, fname_buffer); + hstrcpy(component, &name); } break; } @@ -105,7 +106,7 @@ __vfs_walk(struct v_dnode* start, } // reposition the resolved subtree pointed by symlink - vfs_dcache_rehash(current_level->parent, dnode); + // vfs_dcache_rehash(current_level->parent, dnode); current_level = dnode; current_inode = dnode->inode; }