summaryrefslogtreecommitdiffstats
path: root/src/ft_process_arg.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 14:51:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 14:51:45 +0200
commitc9e4fb6e2ad07e13cf41d6ce6afad30b04011765 (patch)
tree74d816c107c959315ae52166dac96fe2fe0c2a5e /src/ft_process_arg.c
parentWell well well that wasn't too bad, now remake everything (diff)
download42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.gz
42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.bz2
42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.xz
42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.zst
42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.zip
Solid base
Diffstat (limited to '')
-rw-r--r--src/ft_process_arg.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/ft_process_arg.c b/src/ft_process_arg.c
deleted file mode 100644
index 8057e42..0000000
--- a/src/ft_process_arg.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ************************************************************************** */
-/* LE - / */
-/* / */
-/* ft_process_arg.c .:: .:/ . .:: */
-/* +:+:+ +: +: +:+:+ */
-/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */
-/* #+# #+ #+ #+# */
-/* Created: 2019/11/01 18:47:30 by rbousset #+# ## ## #+# */
-/* Updated: 2019/11/01 18:47:32 by rbousset ### #+. /#+ ###.fr */
-/* / */
-/* / */
-/* ************************************************************************** */
-
-#include <libft.h>
-#include <stdlib.h>
-#include <minishell.h>
-#include <inttypes.h>
-
-int
-ft_process_arg(char *arg)
-{
- char **com;
- char *prev;
- uint8_t i;
-
- if (arg[0] == '\0')
- return (0);
- if (ft_strncmp(arg, "r", 1))
- ft_history(arg);
- i = 0;
- com = ft_split(arg, ' ');
- while (com[i])
- i++;
- if (!ft_strncmp(com[0], "exit", ft_strlen(com[0])))
- return (ft_exit(com));
- else if (!ft_strncmp(com[0], "echo", ft_strlen(com[0])))
- return (ft_echo(com, i));
- else if (!ft_strncmp(com[0], "pwd", ft_strlen(com[0])))
- return (ft_pwd());
- else if (!ft_strncmp(com[0], "r", 1))
- {
- prev = ft_get_last_line();
- ft_putendl(prev);
- ft_history("r");
- ft_process_arg(prev);
- free(prev);
- }
- else
- return (ft_exec(com));
- return (0);
-}