diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:09:05 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:09:05 +0200 |
commit | 757801bea2d236148e061324716425fc0e6aa686 (patch) | |
tree | ebe2d3a0fd391cb9147aa0bcc9987786c83dfb96 /src/p_args_quotes.c | |
parent | Better conditions, fuck the norm niggas (diff) | |
download | 42-minishell-757801bea2d236148e061324716425fc0e6aa686.tar.gz 42-minishell-757801bea2d236148e061324716425fc0e6aa686.tar.bz2 42-minishell-757801bea2d236148e061324716425fc0e6aa686.tar.xz 42-minishell-757801bea2d236148e061324716425fc0e6aa686.tar.zst 42-minishell-757801bea2d236148e061324716425fc0e6aa686.zip |
In progress
Diffstat (limited to 'src/p_args_quotes.c')
-rw-r--r-- | src/p_args_quotes.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/p_args_quotes.c b/src/p_args_quotes.c new file mode 100644 index 0000000..2b47b6b --- /dev/null +++ b/src/p_args_quotes.c @@ -0,0 +1,44 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* p_args_quotes.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 <libft.h> +#include <stdint.h> + +#include "d_define.h" + +static void + p_arg_squotes(char word[]) +{ + ft_memmove(word, word + 1, ft_strlen(word)); +} + +static void + p_arg_dquotes(char word[]) +{ + (void)word; +} + +void + p_args_quotes(char *words[]) +{ + char **ptr; + + ptr = words; + while (*ptr != NULL) + { + if (**ptr == C_SQUOTE) + p_arg_squotes(*ptr); + else if (**ptr == C_DQUOTE) + p_arg_dquotes(*ptr); + ptr++; + } +} |