Shell: Fix type builtin PATH resolution
We were not adding a '/' between PATH dir and the command
This commit is contained in:
@@ -217,8 +217,9 @@ void Builtin::initialize()
|
|||||||
{
|
{
|
||||||
char path_buffer[PATH_MAX];
|
char path_buffer[PATH_MAX];
|
||||||
memcpy(path_buffer, path_dir.data(), path_dir.size());
|
memcpy(path_buffer, path_dir.data(), path_dir.size());
|
||||||
memcpy(path_buffer + path_dir.size(), argument.data(), argument.size());
|
path_buffer[path_dir.size()] = '/';
|
||||||
path_buffer[path_dir.size() + argument.size()] = '\0';
|
memcpy(path_buffer + path_dir.size() + 1, argument.data(), argument.size());
|
||||||
|
path_buffer[path_dir.size() + 1 + argument.size()] = '\0';
|
||||||
|
|
||||||
if (is_executable_file(path_buffer))
|
if (is_executable_file(path_buffer))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user