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); }