From 5f0dd75c1f5b9bd7290524cb4a8c46bb667745bc Mon Sep 17 00:00:00 2001 From: Tobias Frost Date: Fri, 10 Jun 2022 11:39:52 +0200 Subject: [PATCH] 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. --- client/readline.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/readline.c b/client/readline.c index 2d54844..dde09ad 100644 --- a/client/readline.c +++ b/client/readline.c @@ -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 }