diff --git a/kshell/commands/cd.cpp b/kshell/commands/cd.cpp index f8d2668..89f9ad0 100644 --- a/kshell/commands/cd.cpp +++ b/kshell/commands/cd.cpp @@ -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); diff --git a/kshell/commands/ls.cpp b/kshell/commands/ls.cpp index 9509f9d..005811f 100644 --- a/kshell/commands/ls.cpp +++ b/kshell/commands/ls.cpp @@ -89,6 +89,9 @@ void cmd_ls(const char *args) return; } + if (thisNode->Type == NodeType::SYMLINK) + thisNode = fs->GetNodeFromPath(thisNode->Symlink); + if (thisNode->Type != NodeType::DIRECTORY) { printf("%s%s\n", ColorNodeType(thisNode), thisNode->Name);