diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-04 22:24:49 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-04 22:24:49 +0200 |
commit | 385b5c002a83d4683d29d9d4f306d929e1ad1e41 (patch) | |
tree | 57a30de3dc9da05da4b98103164a01d859266b93 /src | |
parent | Time to escape chars (diff) | |
download | 42-minishell-385b5c002a83d4683d29d9d4f306d929e1ad1e41.tar.gz 42-minishell-385b5c002a83d4683d29d9d4f306d929e1ad1e41.tar.bz2 42-minishell-385b5c002a83d4683d29d9d4f306d929e1ad1e41.tar.xz 42-minishell-385b5c002a83d4683d29d9d4f306d929e1ad1e41.tar.zst 42-minishell-385b5c002a83d4683d29d9d4f306d929e1ad1e41.zip |
gotta do stuff
Diffstat (limited to '')
-rw-r--r-- | src/p_args.c | 7 | ||||
-rw-r--r-- | src/p_args_escape.c | 30 | ||||
-rw-r--r-- | src/p_args_escape.h | 18 | ||||
-rw-r--r-- | src/p_args_quotes.c | 3 |
4 files changed, 53 insertions, 5 deletions
diff --git a/src/p_args.c b/src/p_args.c index c25fc40..9ce0230 100644 --- a/src/p_args.c +++ b/src/p_args.c @@ -17,6 +17,7 @@ #include "d_define.h" #include "p_args.h" #include "p_args_next.h" +#include "p_args_escape.h" #include "p_args_quotes.h" /* ================= */ @@ -139,9 +140,9 @@ static char p_del_alloced_words(words, to_del); return (NULL); } - p_print(words); - p_escape_chars(words); + p_args_escape_chars(words); p_args_quotes(words); + p_print(words); return (words); } @@ -156,11 +157,9 @@ char { if ((words = p_split_words_no_rdr(word)) == NULL) return (NULL); - p_print(words); exit(0); return (words); } - p_print(words); return (words); /* char **words; */ /* char *subst; */ diff --git a/src/p_args_escape.c b/src/p_args_escape.c new file mode 100644 index 0000000..e6c9a24 --- /dev/null +++ b/src/p_args_escape.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* p_args_escape.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <stddef.h> + +void + p_args_escape_chars(char *words[]) +{ + /* TODO: escape \ */ + /* TODO: escape $vars */ + /* TODO: escape $# special vars */ + /* TODO: escape my life */ + char **ptr; + + ptr = words; + while (*ptr != NULL) + { + /* if (**ptr != C_SQUOTE) */ + ptr++; + } +} diff --git a/src/p_args_escape.h b/src/p_args_escape.h new file mode 100644 index 0000000..1b6926c --- /dev/null +++ b/src/p_args_escape.h @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* p_args_escape.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef P_ARGS_ESCAPE_H +#define P_ARGS_ESCAPE_H + +void p_args_escape_chars(char *words[]); + +#endif diff --git a/src/p_args_quotes.c b/src/p_args_quotes.c index d0ade4f..24d39e7 100644 --- a/src/p_args_quotes.c +++ b/src/p_args_quotes.c @@ -45,9 +45,10 @@ static void ft_memmove(word + (ptr - word), ptr + 1, ft_strlen(ptr + 1) + 1); } } - /* TODO: subst various dquotes chars */ } +WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRROOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG + void p_args_quotes(char *words[]) { |