From 912647ce68516e6840f5b706f743af54ffc61b88 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 6 May 2026 15:13:59 +0300 Subject: [PATCH] Shell: Fix type builtin PATH resolution We were not adding a '/' between PATH dir and the command --- userspace/programs/Shell/Builtin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/userspace/programs/Shell/Builtin.cpp b/userspace/programs/Shell/Builtin.cpp index 9f9fea6b..6807cfda 100644 --- a/userspace/programs/Shell/Builtin.cpp +++ b/userspace/programs/Shell/Builtin.cpp @@ -216,9 +216,10 @@ void Builtin::initialize() for (const auto& path_dir : path_dirs) { char path_buffer[PATH_MAX]; - memcpy(path_buffer, path_dir.data(), path_dir.size()); - memcpy(path_buffer + path_dir.size(), argument.data(), argument.size()); - path_buffer[path_dir.size() + argument.size()] = '\0'; + memcpy(path_buffer, path_dir.data(), path_dir.size()); + path_buffer[path_dir.size()] = '/'; + 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)) {