mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 23:14:38 +00:00
Fix handling of symbolic links in cd and ls commands
This commit is contained in:
parent
e327ca783b
commit
5b7d0106a5
@ -36,6 +36,9 @@ void cmd_cd(const char *args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thisNode->Type == NodeType::SYMLINK)
|
||||||
|
thisNode = fs->GetNodeFromPath(thisNode->Symlink);
|
||||||
|
|
||||||
if (thisNode->Type != NodeType::DIRECTORY)
|
if (thisNode->Type != NodeType::DIRECTORY)
|
||||||
{
|
{
|
||||||
printf("cd: %s: Not a directory\n", args);
|
printf("cd: %s: Not a directory\n", args);
|
||||||
|
@ -89,6 +89,9 @@ void cmd_ls(const char *args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thisNode->Type == NodeType::SYMLINK)
|
||||||
|
thisNode = fs->GetNodeFromPath(thisNode->Symlink);
|
||||||
|
|
||||||
if (thisNode->Type != NodeType::DIRECTORY)
|
if (thisNode->Type != NodeType::DIRECTORY)
|
||||||
{
|
{
|
||||||
printf("%s%s\n", ColorNodeType(thisNode), thisNode->Name);
|
printf("%s%s\n", ColorNodeType(thisNode), thisNode->Name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user