diff --git a/src/main.c b/src/main.c index de38e17..ea7885b 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: ttsubo +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/03 12:50:11 by ttsubo #+# #+# */ -/* Updated: 2025/05/04 21:05:24 by ttsubo ### ########.fr */ +/* Updated: 2025/05/05 18:56:10 by ttsubo ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,8 +36,9 @@ static bool prompt(char *program_name, t_minish *minish) line = readline("$ "); if (!line) return (free_prompt(&tokens, &cmds, &line), false); - if (line[0] != '\0') - add_history(line); + if (!line[0]) + return (free(line), true); + add_history(line); tokens = tokenizer(line); cmds = parser(tokens, minish); if (!cmds)