From 09b7db3f7862408490442b6eb1ddde26d30acdce Mon Sep 17 00:00:00 2001 From: Pin Date: Thu, 31 Mar 2022 19:19:22 -0400 Subject: [PATCH] wip --- msh.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/msh.c b/msh.c index e96d176..9348d8a 100644 --- a/msh.c +++ b/msh.c @@ -41,7 +41,11 @@ int (*builtinFunc[]) (char **) = { }; int builtinExit(char **args) { +#if RL_READLINE_VERSION < 0x0602 rl_clear_history(); +#else + clear_history(); +#endif free(args); exit(EXIT_SUCCESS); } @@ -365,6 +369,10 @@ int main() { initShell(); signal(SIGINT, handleBreak); startShell(); +#if RL_READLINE_VERSION < 0x0602 rl_clear_history(); +#else + clear_history(); +#endif exit(EXIT_SUCCESS); }