mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
vfs: on vfs_lookup, return ENOENT if pathlen is 0 and we are looking for the parent
This commit is contained in:
+4
-1
@@ -230,7 +230,10 @@ int vfs_lookup(vnode_t **result, vnode_t *start, char *path, char *lastcomp, int
|
|||||||
size_t pathlen = strlen(path);
|
size_t pathlen = strlen(path);
|
||||||
|
|
||||||
if (pathlen == 0) {
|
if (pathlen == 0) {
|
||||||
__assert((flags & VFS_LOOKUP_PARENT) == 0);
|
if (flags & VFS_LOOKUP_PARENT) {
|
||||||
|
return ENOENT;
|
||||||
|
}
|
||||||
|
|
||||||
vnode_t *r = start;
|
vnode_t *r = start;
|
||||||
int e = highestnodeinmp(start, &r);
|
int e = highestnodeinmp(start, &r);
|
||||||
if (e)
|
if (e)
|
||||||
|
|||||||
Reference in New Issue
Block a user