summaryrefslogtreecommitdiffstats
path: root/src/ft_error.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2019-11-01 18:57:16 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2019-11-01 18:57:16 +0100
commit7cbf04d592608cf36832e25f9b41619df733e0ae (patch)
tree96c0d2006cd53fcbc2a628795b45b118ba9f3189 /src/ft_error.c
parentNow deals with history (diff)
download42-minishell-7cbf04d592608cf36832e25f9b41619df733e0ae.tar.gz
42-minishell-7cbf04d592608cf36832e25f9b41619df733e0ae.tar.bz2
42-minishell-7cbf04d592608cf36832e25f9b41619df733e0ae.tar.xz
42-minishell-7cbf04d592608cf36832e25f9b41619df733e0ae.tar.zst
42-minishell-7cbf04d592608cf36832e25f9b41619df733e0ae.zip
commit
Diffstat (limited to 'src/ft_error.c')
-rw-r--r--src/ft_error.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ft_error.c b/src/ft_error.c
index 7a2b61a..933a22b 100644
--- a/src/ft_error.c
+++ b/src/ft_error.c
@@ -6,7 +6,7 @@
/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2019/10/30 17:21:53 by rbousset #+# ## ## #+# */
-/* Updated: 2019/10/30 17:21:55 by rbousset ### #+. /#+ ###.fr */
+/* Updated: 2019/11/01 18:47:03 by rbousset ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
@@ -22,7 +22,12 @@ ft_error(const char *com, int err)
if (err == 1)
ft_putendl(": too many arguments");
else if (err == 127)
- ft_putendl(": command not found");
+ {
+ if (!ft_strncmp(com, "./", 2))
+ ft_putendl(": no such file or directory");
+ else
+ ft_putendl(": command not found");
+ }
else if (err == 255)
ft_putendl(": numeric argument required");
return (err);