diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 15:52:47 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 15:52:47 +0200 |
commit | 5cb3373a2e5a5109a5d3b72ef45978b98f885706 (patch) | |
tree | 11a0a6f467da3ddf227d2eaf6824c4509242025e /src/f_fail.c | |
parent | ok nice (diff) | |
parent | $? fix (diff) | |
download | 42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.gz 42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.bz2 42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.xz 42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.zst 42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.zip |
Merge branch 'master' into fix-pwd
Diffstat (limited to '')
-rw-r--r-- | src/f_fail.c (renamed from src/ft_f_fail.c) | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/ft_f_fail.c b/src/f_fail.c index 3f43bae..3704b1f 100644 --- a/src/ft_f_fail.c +++ b/src/f_fail.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_f_fail.c :+: :+: :+: */ +/* f_fail.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -16,11 +16,11 @@ #include <unistd.h> #include <errno.h> -#include "ft_d_define.h" -#include "ft_s_struct.h" +#include "d_define.h" +#include "s_struct.h" static void - ft_write_fail(const char concern[], + write_fail(const char concern[], const char msg[], t_msh *msh) { @@ -28,31 +28,23 @@ static void } void - ft_fail_no_options(const char concern[], + f_fail_no_options(const char concern[], t_msh *msh) { - ft_write_fail(concern, FT_FAIL_NO_OPTIONS, msh); + write_fail(concern, FT_FAIL_NO_OPTIONS, msh); } void - ft_fail_identifier(const char concern[], - const char identifier[], - t_msh *msh) + f_fail_identifier(const char concern[], + const char identifier[]) { - ft_dprintf(STDERR_FILENO, "%s: %s: `%s': not a valid identifier\n", - msh->shname, concern, identifier); + ft_dprintf(STDERR_FILENO, "minishell: %s: `%s': not a valid identifier\n", + concern, identifier); } void - ft_fail_too_many_args(const char concern[], + f_fail_too_many_args(const char concern[], t_msh *msh) { - ft_write_fail(concern, FT_FAIL_TOO_MANY_ARGS, msh); -} - -void - ft_fail_alloc(t_msh *msh) -{ - ft_dprintf(STDERR_FILENO, "%s: %s\n", msh->shname, strerror(errno)); - exit(FT_RET_ALLOC); + write_fail(concern, FT_FAIL_TOO_MANY_ARGS, msh); } |