fix(exec): running a command with an absolute path which does not exist now gives correct error

Before, it gave "Is a directory" error, but now it correctly gives "No such file
or directory".
This commit is contained in:
Khaïs COLIN 2025-04-18 09:17:22 +02:00
parent 655ff36351
commit d44691a5b0
2 changed files with 24 additions and 6 deletions

18
test.sh
View file

@ -714,4 +714,22 @@ minishell: : command not found
not printed
EOF
when_run <<EOF "absolute path to command which does not exist"
/cmd/does/not/exist
echo \$?
EOF
expecting <<EOF
minishell: /cmd/does/not/exist: No such file or directory
127
EOF
when_run <<EOF "?\$HOME"
?\$HOME
echo \$?
EOF
expecting <<EOF
minishell: ?/home/khais: No such file or directory
127
EOF
finalize