From 7380a987dd77c2129d0add9c8ff5238640052724 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sun, 24 Oct 2021 01:18:07 -0400 Subject: Initialize and tear down history for readline --- rvsh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rvsh.c b/rvsh.c index 453bca1..423e66c 100644 --- a/rvsh.c +++ b/rvsh.c @@ -194,6 +194,7 @@ int main(void) { put_stream_rev(bash_output_f); + using_history(); while ((line = readline(strrev(prompt = get_bash_prompt()))) != NULL) { add_history(line); @@ -214,6 +215,7 @@ int main(void) { perror("End"); } + rl_clear_history(); free(prompt); return EXIT_SUCCESS; } -- cgit v1.2.3