summaryrefslogtreecommitdiffstats
path: root/src/f_exec.c
diff options
context:
space:
mode:
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));
+ }
}