mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-25 14:04:36 +00:00
kshell: Check for absolute path
This commit is contained in:
parent
032b8acca0
commit
c0df0291eb
@ -558,11 +558,15 @@ void KShellThread()
|
||||
|
||||
std::string path = "/bin/";
|
||||
|
||||
path += cmd_only;
|
||||
if (!fs->PathExists(path.c_str(), nullptr))
|
||||
path = "/usr/bin/";
|
||||
if (fs->PathIsRelative(cmd_only.c_str()))
|
||||
{
|
||||
path += cmd_only;
|
||||
if (!fs->PathExists(path.c_str(), nullptr))
|
||||
path = "/usr/bin/" + cmd_only;
|
||||
}
|
||||
else
|
||||
path = cmd_only;
|
||||
|
||||
path += cmd_only;
|
||||
debug("path: %s", path.c_str());
|
||||
if (fs->PathExists(path.c_str(), nullptr))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user