From 6996c7718e33b270c9ae952ad3e1cd4b5be80ddd Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 19 Apr 2006 19:55:02 +1000 Subject: [PATCH] Always init history on startup, to avoid destorying history multiple times when reading interactively in a non-interactive script darcs-hash:20060419095502-ac50b-abf2fe39cf9c027bdbc69d78fe858e946f7c81f2.gz --- main.c | 2 ++ reader.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 85f92f344..c807048a4 100644 --- a/main.c +++ b/main.c @@ -266,6 +266,7 @@ int main( int argc, char **argv ) env_init(); complete_init(); reader_init(); + history_init(); if( read_init() ) { @@ -337,6 +338,7 @@ int main( int argc, char **argv ) proc_fire_event( L"PROCESS_EXIT", EVENT_EXIT, getpid(), res ); + history_destroy(); complete_destroy(); proc_destroy(); env_destroy(); diff --git a/reader.c b/reader.c index 348d245c4..212a7c528 100644 --- a/reader.c +++ b/reader.c @@ -1631,7 +1631,6 @@ static void reader_interactive_init() al_init( &prompt_list ); - history_init(); common_handle_winch(0); @@ -1658,7 +1657,6 @@ static void reader_interactive_destroy() kill_destroy(); al_foreach( &prompt_list, (void (*)(const void *))&free ); al_destroy( &prompt_list ); - history_destroy(); writestr( L"\n" ); set_color( FISH_COLOR_RESET, FISH_COLOR_RESET );