summaryrefslogtreecommitdiffstats
path: root/src/f_exec.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-10-26 13:42:56 +0100
committersalad <fmoenne-@student.le-101.fr>2020-10-26 13:42:56 +0100
commit0277ddfac754ab4ad5bdd2b692e31a717efbe569 (patch)
tree49d7c5fd3a12248af85e2c3a3254bc1538ae5775 /src/f_exec.c
parentreqdy for MERGE (diff)
parentTODO update (diff)
download42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.gz
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.bz2
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.xz
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.tar.zst
42-minishell-0277ddfac754ab4ad5bdd2b692e31a717efbe569.zip
merge wif master
Diffstat (limited to 'src/f_exec.c')
-rw-r--r--src/f_exec.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/f_exec.c b/src/f_exec.c
index 3587700..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,
+ if (fullpath[0] != C_NUL)
+ {
+ ft_dprintf(STDERR_FILENO,
"minishell: %s: %s\n",
- fullpath,
- strerror(errno));
+ fullpath,
+ strerror(errno));
+ }
+ else
+ {
+ ft_dprintf(STDERR_FILENO,
+ "minishell: %s: %s\n",
+ bin,
+ strerror(errno));
+ }
}