diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-01 16:44:52 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-01 16:44:52 +0200 |
commit | d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a (patch) | |
tree | 680241a07574d5ca389c602a6a546899f665754c /src | |
parent | Update (diff) | |
download | 42-minishell-d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a.tar.gz 42-minishell-d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a.tar.bz2 42-minishell-d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a.tar.xz 42-minishell-d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a.tar.zst 42-minishell-d5a11fcb60022edfc96bf83c9ab8cdb03e6b762a.zip |
Cool
Diffstat (limited to '')
-rw-r--r-- | src/p_args.c | 25 | ||||
-rw-r--r-- | src/s_com.c | 1 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/p_args.c b/src/p_args.c index 6b285da..d8ca029 100644 --- a/src/p_args.c +++ b/src/p_args.c @@ -14,16 +14,39 @@ #include <stdint.h> #include <stdlib.h> +/* ================= */ +/* TODO: DELETE THIS */ +/* ================= */ + +static void +p_print(char *words[]) +{ + char **ptr; + + ptr = words; + while (*ptr != NULL) + { + ft_printf("[%s]\n", *ptr); + ptr++; + } +} + +/* ================== */ +/* TODO: DELETE ABOVE */ +/* ================== */ + char **p_split_args(const char word[], int8_t redir) { char **words; - (void)word; + ft_printf("word at start: [%s]\n", word); if (redir == 0) { + p_print(words); return (words); } + p_print(words); return (words); /* char **words; */ /* char *subst; */ diff --git a/src/s_com.c b/src/s_com.c index 75a5040..99b3158 100644 --- a/src/s_com.c +++ b/src/s_com.c @@ -116,6 +116,7 @@ t_com return (NULL); if ((words = p_split_args(word, com->redir)) == NULL) return (NULL); + /* TODO: subst vars is before getting words fuck my life */ if ((words = p_subst_vars(words, msh)) == NULL) return (NULL); if ((words = p_subst_home(words, msh)) == NULL) |