This commit is contained in:
Pin
2022-03-31 19:19:22 -04:00
parent 2be6bc849f
commit 09b7db3f78

8
msh.c
View File

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