Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
romanmikh committed Sep 26, 2024
1 parent 379ae84 commit 5d7a2c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
Binary file removed minishell
Binary file not shown.
1 change: 0 additions & 1 deletion src/parser/AST_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ t_ast *manage_commands(t_token **tokens, t_ms_data *data)
return (NULL);
set_command_args(command_node, tokens, cmd_arg_count);
post_process_command_args(command_node, cmd_arg_count, data);
// ft_print_2d_arr(command_node->args, "manage_commands, after ppca");
return (command_node);
}

Expand Down
18 changes: 6 additions & 12 deletions src/parser/loc_env_var_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,28 @@ void post_process_command_args(t_ast *command_node, int arg_count, \
int i;
char *processed_arg;
int current_size;
char *tmp_proc_arg;

i = 0;
tmp_proc_arg = NULL;
current_size = arg_count;
while (i < current_size)
{
if (!is_in_single_quotes(command_node->args[i]))
{
handle_local_vars(data, command_node->args[i]);
processed_arg = process_argument(command_node->args[i], data);
tmp_proc_arg = process_argument(command_node->args[i], data);
}
else
processed_arg = ft_substr(command_node->args[i], 1, \
tmp_proc_arg = ft_substr(command_node->args[i], 1, \
ft_strlen(command_node->args[i]) - 2);
free(command_node->args[i]);
ft_printf("processed_arg: %s\n", processed_arg);
processed_arg = ft_remove_quotes(processed_arg, '\"');
ft_printf("processed_arg: %s\n", processed_arg);
processed_arg = ft_remove_quotes(tmp_proc_arg, '\"');
free(tmp_proc_arg);
split_loc_vars(command_node, processed_arg, &current_size, &i);
free(processed_arg);
}
command_node->args[current_size] = NULL;
for (i=0; i < current_size; i++)
{
command_node->args[i] = ft_remove_quotes(command_node->args[i], '\"');
}

//final_quote_removal(current_size, command_node);
ft_print_2d_arr(command_node->args, "ppca after final-quote_removal");
}

char *append_expanded_var(char *processed_arg, char *tmp_ad, \
Expand Down
Empty file removed tokens);
Empty file.

0 comments on commit 5d7a2c2

Please sign in to comment.