diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-02 19:29:23 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-02 19:29:23 +0200 |
commit | c406ac7f909158dfb78ebf69433db6166246ac7a (patch) | |
tree | 0f8ad0f2a5f5b5b34af20c970ae9e36b08724e5c /src | |
parent | Normed p_args (diff) | |
download | 42-minishell-c406ac7f909158dfb78ebf69433db6166246ac7a.tar.gz 42-minishell-c406ac7f909158dfb78ebf69433db6166246ac7a.tar.bz2 42-minishell-c406ac7f909158dfb78ebf69433db6166246ac7a.tar.xz 42-minishell-c406ac7f909158dfb78ebf69433db6166246ac7a.tar.zst 42-minishell-c406ac7f909158dfb78ebf69433db6166246ac7a.zip |
Norming p_args_escape
Diffstat (limited to 'src')
-rw-r--r-- | src/p_args_escape.c | 29 | ||||
-rw-r--r-- | src/p_args_escape.h | 4 |
2 files changed, 15 insertions, 18 deletions
diff --git a/src/p_args_escape.c b/src/p_args_escape.c index abdf3b3..de00861 100644 --- a/src/p_args_escape.c +++ b/src/p_args_escape.c @@ -16,8 +16,7 @@ #include "d_define.h" #include "u_utils.h" -static t_quote_mode - p_escape_squote(char *ptr, char **p, char word[], t_quote_mode mode) +static t_quote_mode p_escape_squote(char *ptr, char **p, char word[], t_quote_mode mode) { if (mode == Q_NONE) { @@ -43,8 +42,7 @@ static t_quote_mode return (mode); } -static t_quote_mode - p_escape_dquote(char *ptr, char **p, char word[], t_quote_mode mode) +static t_quote_mode p_escape_dquote(char *ptr, char **p, char word[], t_quote_mode mode) { if (mode == Q_NONE) { @@ -70,8 +68,7 @@ static t_quote_mode return (mode); } -static void - p_escape_bs(char *ptr, char word[], t_quote_mode mode) +static void p_escape_bs(char *ptr, char word[], t_quote_mode mode) { if (mode == Q_NONE) { @@ -93,8 +90,7 @@ static void } } -static void - p_escape_arg(char word[]) +static void p_escape_arg(char word[]) { char *ptr; t_quote_mode mode; @@ -113,8 +109,7 @@ static void } } -static void - p_replace_bs(char *ptr) +static void p_replace_bs(char *ptr) { char *head; @@ -131,13 +126,15 @@ static void } } -void - p_args_escape_chars_and_quotes(char *words[]) +/* +** TODO: escape \ +** TODO: escape $# special vars +** TODO: comments ################ +** TODO: escape my life +*/ + +void p_args_escape_chars_and_quotes(char *words[]) { - /* TODO: escape \ */ - /* TODO: escape $# special vars */ - /* TODO: comments ################ */ - /* TODO: escape my life */ char **ptr; ptr = words; diff --git a/src/p_args_escape.h b/src/p_args_escape.h index 746a957..c2ffc5d 100644 --- a/src/p_args_escape.h +++ b/src/p_args_escape.h @@ -10,8 +10,8 @@ /* */ /* ************************************************************************** */ -#ifndef P_ARGS_ESCAPE_H -#define P_ARGS_ESCAPE_H +#ifndef FT_P_ARGS_ESCAPE_H +# define FT_P_ARGS_ESCAPE_H void p_args_escape_chars_and_quotes(char *words[]); |