diff --git a/src/minishell.h b/src/minishell.h index 488b30b..d7f989c 100644 --- a/src/minishell.h +++ b/src/minishell.h @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* minishell.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: khais +#+ +:+ +#+ */ +/* By: jguelen +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2025/03/28 14:55/31 by khais #+# #+# */ -/* Updated: 2025/03/28 14:55:31 by khais ### ########.fr */ +/* Created: 2025/03/28 14:55:31 by khais #+# #+# */ +/* Updated: 2025/03/28 16:42:57 by jguelen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -57,6 +57,9 @@ typedef enum e_cmd_type typedef struct s_cmd { t_cmd_type type; + /* + ** flags will probably be useless to us for now. + */ int flags; /* ** Line number the command starts on -> will probably be unused. @@ -73,6 +76,7 @@ typedef struct s_cmd typedef enum e_connector { + FT_INVALID_CONNECTOR, FT_PIPE, FT_AND, FT_OR, diff --git a/src/parser/remove_quotes/remove_quotes.c b/src/parser/remove_quotes/remove_quotes.c index d2e3c34..215c50d 100644 --- a/src/parser/remove_quotes/remove_quotes.c +++ b/src/parser/remove_quotes/remove_quotes.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* remove_quotes.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: khais +#+ +:+ +#+ */ +/* By: jguelen +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/28 13:52:02 by khais #+# #+# */ -/* Updated: 2025/03/07 11:20:48 by khais ### ########.fr */ +/* Updated: 2025/03/28 16:05:25 by jguelen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,13 @@ #include "../matchers/quote.h" #include +static bool is_ignore_mark(char c) +{ + if (c == '\'' || c == '"' || c == '$' || c == '&') + return (true); + return (false); +} + /* ** use the marker in the given worddesc to create a new worddesc by removing ** unquoted quotes. @@ -37,7 +44,7 @@ t_worddesc *remove_quotes(t_worddesc *word) i = 0; while (word->word[i] != '\0') { - if (!is_quote(word->word[i]) || is_quote(word->marker[i])) + if (!is_quote(word->word[i]) || is_ignore_mark(word->marker[i])) buf = ft_buffer_pushchar(buf, word->word[i]); i++; }