diff options
author | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2019-10-29 13:22:04 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2019-10-29 13:22:04 +0100 |
commit | 079d839aee68e52932eacbd8d4c75ba1388b006a (patch) | |
tree | 406665acdbfa9e61fbccad924d4dcc27de0463e1 /src/main.c | |
parent | libft included (diff) | |
download | 42-minishell-079d839aee68e52932eacbd8d4c75ba1388b006a.tar.gz 42-minishell-079d839aee68e52932eacbd8d4c75ba1388b006a.tar.bz2 42-minishell-079d839aee68e52932eacbd8d4c75ba1388b006a.tar.xz 42-minishell-079d839aee68e52932eacbd8d4c75ba1388b006a.tar.zst 42-minishell-079d839aee68e52932eacbd8d4c75ba1388b006a.zip |
tons of changes
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -12,6 +12,7 @@ /* ************************************************************************** */ #include <libft.h> +#include <minishell.h> #include <stdlib.h> #include <stddef.h> #include <unistd.h> @@ -25,8 +26,14 @@ int uint8_t i; i = 0; + arg = NULL; while (1) { + if (arg) + { + free(arg); + arg = NULL; + } if (!(arg = (char*)ft_calloc(129, sizeof(char)))) return (1); write(1, "joe-shell~> ", 12); @@ -44,7 +51,10 @@ int i++; } arg[i] = '\0'; + if (ft_process_arg(arg) == 8) + break ; } free(arg); + arg = NULL; return (0); } |