From 831f45b662fe44899a2b0eaa20d4f551c760d97a Mon Sep 17 00:00:00 2001 From: rick Date: Sat, 20 Feb 2021 16:55:30 +0100 Subject: [PATCH] =?UTF-8?q?V=C3=A9rification=20de=20toute=20la=20commande?= =?UTF-8?q?=20pour=20cd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/boitoutil/essential_shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/boitoutil/essential_shell.c b/src/boitoutil/essential_shell.c index 726044e..5e51f60 100644 --- a/src/boitoutil/essential_shell.c +++ b/src/boitoutil/essential_shell.c @@ -61,8 +61,9 @@ void error(int code, int type, char *message) int native_command(char *command[]) { int ret = 1; /* 0 si commande non native */ - if (!strncmp(command[0], "cd", 2)) + if (!strcmp(command[0], "cd")) change_dir(command[1]); + else ret = 0; return ret;