fix: empty line is now not add to the history
This commit is contained in:
parent
405c1937cd
commit
7728ded62d
3
main.c
3
main.c
@ -31,7 +31,8 @@ static char *ft_get_user_input(t_list **env)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
line = readline(prompt);
|
line = readline(prompt);
|
||||||
add_history(line);
|
if (line != NULL && ft_strcmp(line, "") != 0)
|
||||||
|
add_history(line);
|
||||||
free(prompt);
|
free(prompt);
|
||||||
return (line);
|
return (line);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user