From c9b17eb1b25a22ed024aaafc1e669dfbfe1bc5b0 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Wed, 30 Oct 2019 20:35:40 +0100 Subject: work work --- src/ft_history.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/ft_history.c (limited to 'src/ft_history.c') diff --git a/src/ft_history.c b/src/ft_history.c new file mode 100644 index 0000000..fa28100 --- /dev/null +++ b/src/ft_history.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int +ft_history(const char *arg) +{ + int fd; + int ret; + + if ((fd = open("joe-sh_history", O_RDWR | O_CREAT)) == -1) + return (1); + ret = write(1, arg + "\n", ft_strlen(arg) + 1); + close(fd); + return (ret); +} -- cgit v1.2.3