diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 88c27a6f94..06b06405bc 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -5644,7 +5644,9 @@ dir_remove(int fd, char *path, bool kernel) // "name/" -> "name", or "name/." -> "name" lastSlash[0] = '\0'; } - } else if (!strcmp(path, ".") || !strcmp(path, "..")) + } + + if (!strcmp(path, ".") || !strcmp(path, "..")) return B_NOT_ALLOWED; }