/* ************************************************************************** */ /* */ /* :::::::: */ /* history_write.c :+: :+: */ /* +:+ */ /* By: whaffman +#+ */ /* +#+ */ /* Created: 2025/02/05 17:12:17 by whaffman #+# #+# */ /* Updated: 2025/02/12 12:53:42 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ #include "minishell.h" void history_write(char *line) { int fd; add_history(line); fd = open(".minishell_history", O_WRONLY | O_APPEND | O_CREAT, 0644); if (fd < 0) return ; if (*line) ft_putendl_fd(line, fd); close(fd); }