summaryrefslogtreecommitdiffstats
path: root/src/e_externs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/e_externs.c')
-rw-r--r--src/e_externs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/e_externs.c b/src/e_externs.c
index d7c4854..3d55fa9 100644
--- a/src/e_externs.c
+++ b/src/e_externs.c
@@ -17,6 +17,7 @@
#include <unistd.h>
#include "e_externs_next.h"
+#include "f_fail.h"
#include "m_redirs.h"
#include "s_destroy.h"
#include "s_lcom.h"
@@ -72,8 +73,15 @@ void
{
fullpath = search_in_path(ptr->com, envpath, msh);
ft_delwords(envpath);
+ if (fullpath == NULL)
+ {
+ f_fail_command_not_found(ptr->com);
+ /* TODO: deal if not found etc */
+ }
+ else
+ {
+ exec_path(fullpath, ptr, msh);
+ ft_memdel((void*)&fullpath);
+ }
}
- /* TODO: deal if not found etc */
- exec_path(fullpath, ptr, msh);
- ft_memdel((void*)&fullpath);
}