Fix handling of symbolic links in cd and ls commands

This commit is contained in:
EnderIce2
2024-04-01 03:29:34 +03:00
parent e327ca783b
commit 5b7d0106a5
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,9 @@ void cmd_cd(const char *args)
return;
}
if (thisNode->Type == NodeType::SYMLINK)
thisNode = fs->GetNodeFromPath(thisNode->Symlink);
if (thisNode->Type != NodeType::DIRECTORY)
{
printf("cd: %s: Not a directory\n", args);