kshell: Check for absolute path

This commit is contained in:
EnderIce2 2024-10-22 05:27:43 +03:00
parent 032b8acca0
commit c0df0291eb
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -558,11 +558,15 @@ void KShellThread()
std::string path = "/bin/";
if (fs->PathIsRelative(cmd_only.c_str()))
{
path += cmd_only;
if (!fs->PathExists(path.c_str(), nullptr))
path = "/usr/bin/";
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))
{