* Fixed resolution of symlinks path components, broken since

r24721/r24722. After resolving a symlink we weren't updating the local
  type variable to the type of the link target, so that the directory
  check in the next iteration would always fail.
* Added TODO.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24735 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-04-02 00:51:43 +00:00
parent b9044f36d9
commit 0cc0b6fc8f
1 changed files with 6 additions and 1 deletions

View File

@ -1756,6 +1756,10 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
status_t status = B_OK;
ino_t lastParentID = vnode->id;
int type = 0;
// TODO: Actually the caller could provide the type of the start node,
// if known, which it is in most cases (context root, mount root, cwd).
// We'd save a now always required read_stat().
// Doing that via _type wouldn't even require an interface change.
FUNCTION(("vnode_path_to_vnode(vnode = %p, path = %s)\n", vnode, path));
@ -1923,9 +1927,10 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
if (absoluteSymlink && *path == '\0') {
// symlink was just "/"
nextVnode = vnode;
type = S_IFDIR;
} else {
status = vnode_path_to_vnode(vnode, path, traverseLeafLink,
count + 1, ioContext, &nextVnode, &lastParentID, _type);
count + 1, ioContext, &nextVnode, &lastParentID, &type);
}
free(buffer);