From 53a5dc3296b363cdb3375dfa7ef3ff582d3cbd1b Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Tue, 29 Oct 2019 13:54:42 +0100 Subject: commit, lotta stuff --- src/ft_process_arg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ft_process_arg.c') diff --git a/src/ft_process_arg.c b/src/ft_process_arg.c index d82f9da..e1b6f8f 100644 --- a/src/ft_process_arg.c +++ b/src/ft_process_arg.c @@ -2,12 +2,23 @@ #include #include +int +ft_not_found(const char *com) +{ + ft_putstr("joe-sh: "); + ft_putstr(com); + ft_putendl(": command not found"); + return (127); +} + int ft_process_arg(const char *arg) { char **com; uint8_t i; + if (arg[0] == '\0') + return (0); i = 0; com = ft_split(arg, ' '); while (com[i]) @@ -18,5 +29,7 @@ ft_process_arg(const char *arg) ft_echo(com, i); else if (!ft_strncmp(com[0], "pwd", ft_strlen(com[0]))) ft_pwd(); + else + ft_not_found(com[0]); return (0); } -- cgit v1.2.3