diff options
Diffstat (limited to 'src/ft_error.c')
-rw-r--r-- | src/ft_error.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 <libft.h> +#include <minishell.h> + +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); +} |