-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtermcap_tools.c
More file actions
47 lines (43 loc) · 1.44 KB
/
Copy pathtermcap_tools.c
File metadata and controls
47 lines (43 loc) · 1.44 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* termcap_tools.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fbouibao <fbouibao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/06/12 13:02:51 by fbouibao #+# #+# */
/* Updated: 2021/06/12 13:09:45 by fbouibao ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell_hr.h"
void get_last_cmd(t_history **history, t_history **h_tmp)
{
while (1)
{
if ((*history)->next == NULL)
break ;
(*history) = (*history)->next;
}
*h_tmp = *history;
g_all->termcap_mod = 0;
}
void get_last_cmd2(t_history **h_tmp)
{
while (1)
{
if ((*h_tmp)->next == NULL)
break ;
(*h_tmp) = (*h_tmp)->next;
}
g_all->termcap_mod = 0;
}
void key_down_cnt(void)
{
free(g_all->ret);
if (g_all->line)
g_all->ret = ft_strdup(g_all->line);
else
g_all->ret = NULL;
write(1, g_all->ret, ft_strlen(g_all->ret));
g_all->termcap_mod = 0;
}