This commit is contained in:
whaffman 2025-03-07 17:49:30 +01:00
parent ace00a615b
commit 56db1cff1b
2 changed files with 12 additions and 11 deletions

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* parser_process_token.c :+: :+: :+: */ /* parser_process_token.c :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/03/05 21:12:15 by qmennen #+# #+# */ /* Created: 2025/03/05 21:12:15 by qmennen #+# #+# */
/* Updated: 2025/03/05 21:42:44 by qmennen ### ########.fr */ /* Updated: 2025/03/07 17:48:48 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -28,7 +28,7 @@ static int parser_should_expand(t_list *value)
{ {
t_val = token->value; t_val = token->value;
if (t_val[i] == '~' && (t_val[i + 1] == '/' || t_val[i + 1] == ' ' if (t_val[i] == '~' && (t_val[i + 1] == '/' || t_val[i + 1] == ' '
|| t_val[i + 1] == 0) && token->type == T_WORD) || t_val[i + 1] == 0) && token->type == T_WORD)
return (1); return (1);
else if (t_val[i] == '$' && expander_character_valid(t_val[i + 1])) else if (t_val[i] == '$' && expander_character_valid(t_val[i + 1]))
return (1); return (1);
@ -39,7 +39,9 @@ static int parser_should_expand(t_list *value)
return (0); return (0);
} }
//TODO: Make an exception for this `echo hey""you "" test`. here echo actually interprets "" as an extra space. Just check if its empty and surrounded by spaces or sth. Can't be asked rn //TODO: Make an exception for this `echo hey""you "" test`.
// here echo actually interprets "" as an extra space. Just check if
// its empty and surrounded by spaces or sth. Can't be asked rn
char *parser_process_token(t_minishell *msh, t_list *prev, t_list *t_head) char *parser_process_token(t_minishell *msh, t_list *prev, t_list *t_head)
{ {
char *str; char *str;

View File

@ -6,7 +6,7 @@
/* By: qmennen <qmennen@student.codam.nl> +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/23 12:29:05 by Quinten #+# #+# */ /* Created: 2025/02/23 12:29:05 by Quinten #+# #+# */
/* Updated: 2025/03/07 17:41:51 by whaffman ######## odam.nl */ /* Updated: 2025/03/07 17:47:18 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -16,7 +16,6 @@ static void check_heredoc(t_minishell *msh, t_list *current, t_token *token)
{ {
if (token->type == T_HEREDOC && redirect_is_valid(current, token, -1)) if (token->type == T_HEREDOC && redirect_is_valid(current, token, -1))
fork_for_heredoc(msh, token, current->next->content); fork_for_heredoc(msh, token, current->next->content);
} }
t_list *redirect_get_inputs(t_minishell *msh, t_list *list) t_list *redirect_get_inputs(t_minishell *msh, t_list *list)