From 27ea0240a97d0745dda0f87940bfe5940f9c594c Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Wed, 30 Oct 2019 16:32:46 +0100 Subject: work work --- src/ft_error.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/ft_error.c (limited to 'src/ft_error.c') diff --git a/src/ft_error.c b/src/ft_error.c new file mode 100644 index 0000000..2cc9cb6 --- /dev/null +++ b/src/ft_error.c @@ -0,0 +1,14 @@ +#include +#include + +void +ft_error(const char *com, int errno) +{ + ft_putstr("joe-sh: "); + ft_putstr(com); + if (errno == 1) + ft_putendl(": too many arguments"); + else if (errno == 127) + ft_putendl(": command not found"); + return (errno); +} -- cgit v1.2.3