-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_cut_list.c
27 lines (24 loc) · 1.22 KB
/
ft_cut_list.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_cut_list.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dlana <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/29 20:20:56 by dlana #+# #+# */
/* Updated: 2021/09/29 20:20:56 by dlana ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ft_cut_list(t_list **cut_list, t_list **p_to_struct)
{
t_list *p_2;
t_list *p_tail;
(*cut_list) = (*p_to_struct);
p_2 = (*p_to_struct)->next;
p_tail = (*p_to_struct);
p_tail = p_tail->prev;
(*p_to_struct) = (*p_to_struct)->next;
(*p_to_struct)->prev = p_tail;
p_tail->next = (*p_to_struct);
}