aboutsummaryrefslogtreecommitdiff
path: root/src/praise_the_norme.c
blob: 6af28c366185a103551a48a16e8b4981fe003c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   praise_the_norme.c                                 :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2025/01/20 18:35:41 by dkaiser           #+#    #+#             */
/*   Updated: 2025/01/22 17:30:02 by dkaiser          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "minishell.h"

void	i_love_the_norme(t_token **cur, t_token **tokens)
{
	t_token	*next_token;

	next_token = (*cur)->next;
	free_token_and_connect2(*cur);
	if (next_token)
	{
		if (next_token->previous == NULL)
			*tokens = next_token->next;
		*cur = next_token->next;
		free_token_and_connect2(next_token);
	}
	else
		*cur = NULL;
}