diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-15 19:59:41 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-15 19:59:41 +0200 |
commit | ca2e36781039eb7e9901ccde395600e7af87ff4f (patch) | |
tree | 8a9d85433e943fbbd079bc55700e048a54d9bf24 /src/f_exec.c | |
parent | type builtin fix (diff) | |
download | 42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.gz 42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.bz2 42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.xz 42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.tar.zst 42-minishell-ca2e36781039eb7e9901ccde395600e7af87ff4f.zip |
Huge fixes and stack stuff
Diffstat (limited to 'src/f_exec.c')
-rw-r--r-- | src/f_exec.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/f_exec.c b/src/f_exec.c index fccfdea..37cb0f2 100644 --- a/src/f_exec.c +++ b/src/f_exec.c @@ -15,13 +15,23 @@ #include <errno.h> #include <unistd.h> +#include "d_define.h" #include "s_struct.h" -void - f_exec(const char fullpath[]) +void f_exec(const char fullpath[], const char bin[]) { - ft_dprintf(STDERR_FILENO, - "minishell: %s: %s\n", - fullpath, - strerror(errno)); + if (fullpath[0] != C_NUL) + { + ft_dprintf(STDERR_FILENO, + "minishell: %s: %s\n", + fullpath, + strerror(errno)); + } + else + { + ft_dprintf(STDERR_FILENO, + "minishell: %s: %s\n", + bin, + strerror(errno)); + } } |