aboutsummaryrefslogtreecommitdiff
path: root/src/parse_cmd.c
diff options
context:
space:
mode:
authorDominik Kaiser2025-01-20 18:46:39 +0100
committerGitHub2025-01-20 18:46:39 +0100
commit9fa887da20e409c2f25fac44b57f999e508a30ea (patch)
tree7e3fee3edea18d0d81abddb89104858cfc0ec5e3 /src/parse_cmd.c
parentaf9d1a9b39daaf1b86cf94ee629e06503d8ab6d4 (diff)
parent62845ce01f222fad126372c574c7ab084478adf0 (diff)
downloadminishell-9fa887da20e409c2f25fac44b57f999e508a30ea.tar.gz
minishell-9fa887da20e409c2f25fac44b57f999e508a30ea.zip
Merge pull request #30 from dpu-kaiser/merge_format_redir
Merge format redir
Diffstat (limited to 'src/parse_cmd.c')
-rw-r--r--src/parse_cmd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/parse_cmd.c b/src/parse_cmd.c
index 92dfd12..d13bf3f 100644
--- a/src/parse_cmd.c
+++ b/src/parse_cmd.c
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/08 15:06:25 by dkaiser #+# #+# */
-/* Updated: 2025/01/16 19:06:03 by dkaiser ### ########.fr */
+/* Updated: 2025/01/20 12:44:44 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,7 +18,7 @@ t_node *parse_cmd(t_token *tokens, t_env **env)
{
char **args;
t_redirection *redirs;
- t_list *create_files;
+ t_list *create_files;
create_files = NULL;
redirs = collect_redirs(&tokens, *env, &create_files);
@@ -36,6 +36,7 @@ t_node *parse_cmd(t_token *tokens, t_env **env)
static char **collect_args(t_token **tokens, t_env **env)
{
t_token *cur;
+ t_token *next;//2
char **result;
int i;
@@ -50,12 +51,14 @@ static char **collect_args(t_token **tokens, t_env **env)
i = 0;
while (cur != NULL && cur->type == STRING_TOKEN)
{
+ next = cur->next;//2
if (cur->previous)
free_token(cur->previous);
- result[i] = format_string(cur->content.string, *env);
+ result[i] = format_string(cur->content.string, *env, ft_atoi("0"));
i++;
- cur = cur->next;
+ // cur = cur->next;
+ cur = next;//2
}
result[i] = NULL;
return (result);
-}
+} \ No newline at end of file