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.c22
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));
+ }
}