Use rl_clear_history only if available, fallback to clear_history if not.

For ancient readline (I'm stuck to it on my embedded target...),
rl_clear_history is not available, so using clear_history instead.
This commit is contained in:
Tobias Frost 2022-06-10 11:39:52 +02:00
parent 6f097d37e6
commit 5f0dd75c1f

View File

@ -917,6 +917,10 @@ void readline_exit(void)
{
if (!quit)
rl_callback_handler_remove();
#if (RL_VERSION_MAJOR<=5 || (RL_VERSION_MAJOR==6 && RL_VERSION_MINOR<=3))
clear_history();
#else
rl_clear_history();
#endif
}