bonus
This commit is contained in:
@ -6,23 +6,23 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/06 20:46:19 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:24:55 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/28 14:30:24 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
t_token *cmd_add_back(t_token *cmd, char *value, t_token_type type)
|
||||
t_cmd *cmd_add_back(t_cmd *cmd, char *value, t_cmd_type type)
|
||||
{
|
||||
t_token *res;
|
||||
t_token *current;
|
||||
t_cmd *res;
|
||||
t_cmd *current;
|
||||
|
||||
if (value && !*value)
|
||||
{
|
||||
free(value);
|
||||
return (cmd);
|
||||
}
|
||||
res = ft_calloc(1, sizeof(t_token));
|
||||
res = ft_calloc(1, sizeof(t_cmd));
|
||||
if (!res)
|
||||
return (cmd);
|
||||
res->value = value;
|
||||
@ -36,7 +36,7 @@ t_token *cmd_add_back(t_token *cmd, char *value, t_token_type type)
|
||||
return (cmd);
|
||||
}
|
||||
|
||||
t_token *free_cmd(t_token *cmd)
|
||||
t_cmd *free_cmd(t_cmd *cmd)
|
||||
{
|
||||
if (cmd)
|
||||
{
|
||||
|
Reference in New Issue
Block a user