avant de merge
This commit is contained in:
parent
bd33e1c9f2
commit
d6c6103bc4
3 changed files with 12 additions and 6 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */
|
||||
/* Updated: 2017/01/26 13:36:59 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/01/26 14:58:14 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -71,6 +71,7 @@ typedef struct s_line
|
|||
t_list_history *list_beg;
|
||||
} t_line;
|
||||
|
||||
int builtin_history(const char *path, char *const av[], char *const envp[]);
|
||||
void ft_check_backslash(char **str);
|
||||
char *ft_strget_history(char *str);
|
||||
void ft_surch_in_history(char **str, size_t *pos);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* is_builtin.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/13 13:09:57 by jhalford #+# #+# */
|
||||
/* Updated: 2017/01/09 16:58:13 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/01/26 14:58:02 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ t_stof g_builtin[] = {
|
|||
{"jobs", &builtin_jobs},
|
||||
{"fg", &builtin_fg},
|
||||
{"bg", &builtin_bg},
|
||||
{"history", &builtin_history},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,21 +6,24 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/01/24 14:54:53 by gwojda #+# #+# */
|
||||
/* Updated: 2017/01/25 15:48:52 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/01/26 14:58:41 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
void ft_history_builtin(void)
|
||||
int builtin_history(const char *path, char *const av[], char *const envp[])
|
||||
{
|
||||
size_t len;
|
||||
t_list_history *head;
|
||||
|
||||
(void)path;
|
||||
(void)av;
|
||||
(void)envp;
|
||||
head = data_singleton()->line.list_end;
|
||||
len = 1;
|
||||
if (!head)
|
||||
return ;
|
||||
return (0);
|
||||
if (head && !head->str)
|
||||
head = head->next;
|
||||
while (head && head->str)
|
||||
|
|
@ -31,4 +34,5 @@ void ft_history_builtin(void)
|
|||
++len;
|
||||
head = head->next;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue