From c9e4fb6e2ad07e13cf41d6ce6afad30b04011765 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 20 Apr 2020 14:51:45 +0200 Subject: Solid base --- src/ft_exec.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/ft_exec.c (limited to 'src/ft_exec.c') diff --git a/src/ft_exec.c b/src/ft_exec.c deleted file mode 100644 index 408697d..0000000 --- a/src/ft_exec.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ************************************************************************** */ -/* LE - / */ -/* / */ -/* ft_exec.c .:: .:/ . .:: */ -/* +:+:+ +: +: +:+:+ */ -/* By: rbousset +:+ +: +: +:+ */ -/* #+# #+ #+ #+# */ -/* Created: 2019/11/01 18:46:50 by rbousset #+# ## ## #+# */ -/* Updated: 2019/11/01 18:47:21 by rbousset ### #+. /#+ ###.fr */ -/* / */ -/* / */ -/* ************************************************************************** */ - -#include -#include -#include -#include - -int -ft_exec(char **com) -{ - uint8_t i; - - i = 0; - while (com[i]) - i++; - if (fork() == 0) - { - if (!ft_strncmp(com[0], "./", 2)) - { - if ((execve(com[0] + 2, com, NULL)) != 0) - return (ft_error(com[0], 127)); - } - else - if ((execve(com[0], com, NULL)) != 0) - return (ft_error(com[0], 127)); - } - return (0); -} -- cgit v1.2.3