Merge pull request #5 from coldtobi/fix_4_ancient_readline

Use rl_clear_history only if available, fallback to clear_history if not
This commit is contained in:
sstefani 2022-06-10 14:47:39 +02:00 committed by GitHub
commit cb502b8676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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